home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / thread / piserve / service.hpp < prev   
Text File  |  1996-10-29  |  2KB  |  46 lines

  1. #ifndef _SERVICE_
  2. #define _SERVICE_
  3. /***************************************************************
  4. * FILE NAME: service.hpp                                       *
  5. *                                                              *
  6. * DESCRIPTION:                                                 *
  7. *   This file contains the declaration(s) of the class(es):    *
  8. *     ServiceThread - Long-running thread that you can post    *
  9. *                     requests to.                             *
  10. *                                                              *
  11. * COPYRIGHT:                                                   *
  12. *   Licensed Materials - Property of Solution Frameworks       *
  13. *   Copyright (C) 1996, Solution Frameworks                    *
  14. *   All Rights Reserved                                        *
  15. ***************************************************************/
  16. #ifndef _ITHREAD_
  17.   #include <ithread.hpp>
  18. #endif
  19.  
  20. class ServiceThreadData;
  21.  
  22. class ServiceThread {
  23. public:
  24. /*----------------- Constructors/Destructor --------------------
  25. | Note that the constructor automatically starts a secondary   |
  26. | thread of execution and the destructor terminates that       |
  27. | thread.                                                      |
  28. --------------------------------------------------------------*/
  29.   ServiceThread ( );
  30.   ~ServiceThread ( );
  31.  
  32. /*--------------------- Request Handling -----------------------
  33. | Use this function to post a request to the thread.           |
  34. --------------------------------------------------------------*/
  35. virtual void
  36.   postRequest( const IReference<IThreadFn> &request );
  37.  
  38. private:
  39. static void
  40.   run ( void * );
  41. ServiceThreadData
  42.  *data;
  43. }; // ServiceThread
  44.  
  45. #endif // _SERVICE_
  46.