Converted tabs to spaces. Removed trailing whitespaces.

This commit is contained in:
Maciej Suminski
2013-10-14 13:43:57 +02:00
parent ac489ece7b
commit 22045b61ea
55 changed files with 2739 additions and 2740 deletions
+29 -29
View File
@@ -9,40 +9,40 @@ typedef COROUTINE<int, int> MyCoroutine;
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);
for(int i = 1; i <= n; i++)
{
printf("%s: Yielding %d\n", __FUNCTION__, i);
cofunc.Yield(i);
}
}
public:
int CountTo(int n)
{
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);
}
}
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__);
}
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();
}
MyCoroutine cofunc;
printf("%s: Done!\n", __FUNCTION__);
}
MyCoroutine cofunc;
};
main()
{
MyClass obj;
MyClass obj;
obj.Run();
return 0;
}
obj.Run();
return 0;
}