I have a class derived from CActive class.
Is there a way to specifically wait on an instance of the class?
I found CActiveScheduler::WaitForAnyRequest() which I assume I can use to wait continuosly, and each time it returns I can check my object. Is that a good idea? Can I assume the scheduler I get from CActiveScheduler::Current() contains my CActive object.
I also thought about using User::WaitForRequest() but I'm not sure how I connect the speicifc TRequestStatus with my CActive object.
Let me describe what I want to do and maybe you can direct me in the right direction.
I have a rather long operation, which reads a sequence of bitmaps and processes them. I want to have a simple loop in which each iteration reads 1 bitmap and processes it.
I'm using a CImageDecoder for the read. After I call it's Convert() method, I need to wait for the async operation to complete. How do I do that? Is is possible to do it without leaving my function and loop.
I also have a general question regarding async operations. Which thread runs these operations? How and when do they get scheduled? Is there any in depth document of symbian's threading and event handling mechanisms?
I', quite sure you can do it in standard AO way, just have some sort of array made, which you process one by one, while keeping in memory which one of the items you are currently working with. then you just wait in your RunL when one round is ready and increase the count of processed loops there.
Basically AO's are scheduled inside the tread they are called in. There is a quite good document in decoments section descriping AO's and active scheduler, as well as the concepts are explained quite well in many of the symbian books available.