Recent Posts
Lua | 20 sec ago
None | 41 sec ago
AutoIt | 47 sec ago
Haskell | 49 sec ago
Java | 50 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 9th of Feb 2010 07:00:12 PM Download | Raw | Embed | Report
  1. Using CActive
  2.  
  3. --------------------------------------------------------------------------------
  4.  
  5. Writing derived classes
  6. A CActive-derived class must fulfil a number of requirements, including providing a constructor and a number of functions.
  7.  
  8. To write a class which encapsulates an asynchronous service:
  9.  
  10. define and implement a C++ constructor through which the priority of the active object can be specified. A typical implementation calls the CActive constructor through a constructor initialization list.
  11.  
  12. define data members representing the asynchronous service provider; the number and meaning of these members depends on the services offered by the service provider
  13.  
  14. define and implement a second-phase ConstructL() member function, if this is necessary to initialise contact with the asynchronous service provider.
  15.  
  16. define and implement a DoCancel() member function to handle a cancel request to the service provider. This function is defined as pure virtual in CActive and any class derived from CActive must define and implement it.
  17.  
  18. define and implement one or more service request functions which forward requests to the service provider
  19.  
  20. To write a class which handles the completion of an asynchronous request, a RunL() function should be provided. The function is defined as pure virtual in CActive and any class derived from CActive must define and implement it. RunL():
  21.  
  22. handles completion of a request, if appropriate
  23.  
  24. if appropriate, renews the request, or initiates other requests, or decides to terminate the series of requests handled by the active object
  25.  
  26. In some cases, a derived-class's RunL() will do some pre-handling of the request, and then invoke one or more appropriate virtual functions to handle particular types of completion. A further-derived class must provide virtual functions to specify the way various types of completion are handled.
  27.  
  28. In the general case, the derivation of a concrete active object from the CActive base class may involve
  29.  
  30. a derivation for encapsulating the service
  31.  
  32. a derivation for encapsulating the abstract handling of completion
  33.  
  34. further derivations for making that handling more concrete
  35.  
  36. Depending on the circumstances, some of these stages of derivation may be amalgamated into one stage; or stages may be refined into even finer derivation stages.
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: