Namespace KiGfx->KIGFX.

template<> -> template <>
Some more reformatting according to uncrustify results.
This commit is contained in:
Maciej Suminski
2013-10-14 16:13:35 +02:00
parent 8253899a70
commit e66a4ce337
139 changed files with 1120 additions and 965 deletions
+28 -25
View File
@@ -7,39 +7,42 @@ using namespace std;
typedef COROUTINE<int, int> MyCoroutine;
class MyClass {
class MyClass
{
public:
int CountTo( int n )
{
printf( "%s: Coroutine says hi. I will count from 1 to %d and yield each value.\n",
__FUNCTION__,
n );
public:
int CountTo(int n)
for( int i = 1; i <= n; i++ )
{
printf("%s: Coroutine says hi. I will count from 1 to %d and yield each value.\n", __FUNCTION__, n);
for(int i = 1; i <= n; i++)
{
printf("%s: Yielding %d\n", __FUNCTION__, i);
cofunc.Yield(i);
}
printf( "%s: Yielding %d\n", __FUNCTION__, i );
cofunc.Yield( i );
}
}
void Run()
{
cofunc = MyCoroutine( this, &MyClass::CountTo );
printf( "%s: Calling coroutine that will count from 1 to 5.\n", __FUNCTION__ );
cofunc.Call( 5 );
while( cofunc.Running() )
{
printf( "%s: Got value: %d\n", __FUNCTION__, cofunc.ReturnValue() );
cofunc.Resume();
}
void Run()
{
cofunc = MyCoroutine (this, &MyClass::CountTo);
printf("%s: Calling coroutine that will count from 1 to 5.\n", __FUNCTION__);
cofunc.Call(5);
while (cofunc.Running())
{
printf("%s: Got value: %d\n", __FUNCTION__, cofunc.ReturnValue());
cofunc.Resume();
}
printf( "%s: Done!\n", __FUNCTION__ );
}
printf("%s: Done!\n", __FUNCTION__);
}
MyCoroutine cofunc;
MyCoroutine cofunc;
};
main()
{
main() {
MyClass obj;
obj.Run();