home *** CD-ROM | disk | FTP | other *** search
/ C/C++ User's Journal & Wi…eveloper's Journal Tools / C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso / smxdemo / smxpp / task.hpp < prev   
Encoding:
C/C++ Source or Header  |  1993-01-16  |  1.3 KB  |  60 lines

  1. /*************************************************************************
  2. *     Copyright (c) 1989-1992 Micro Digital Associates, Inc.
  3. *                     All Rights Reserved.
  4. *
  5. *  MODULE: TASK.HPP
  6. *
  7. *  DESRIPTION:
  8. *              This is the header file for the task class. It contains the
  9. *              class definition.
  10. *
  11. *
  12. *  AUTHOR: Rick Evans 
  13. *
  14. *
  15. *************************************************************************/
  16.  
  17. #ifndef __TASK_HPP
  18. #define __TASK_HPP   1
  19.  
  20. #include <xtypes.h>
  21.  
  22. class Task
  23. {
  24.  
  25.    TCB_PTR     TaskCBP;     
  26.  
  27. public:
  28.    //---- constructors -----
  29.    //Create a task from scatch
  30.     Task( const void(*TaskMain)(), byte priority, word stackSize=0 );
  31.  
  32.    //Copy a existing Task.
  33.     Task( const Task& t );
  34.  
  35.     Task( TCB_PTR p );
  36.  
  37.    //----- methods -----------
  38.     BOOLEAN  Hook( const void(*hookMain)() );
  39.     void     Lock();
  40.     void     UnLock();
  41.     void     StackCheckOn();
  42.     void     StackCheckOff();
  43.     BOOLEAN  Start();
  44.     BOOLEAN  Start( word parm );
  45.     BOOLEAN  Start( byte Priority );
  46.     BOOLEAN  Start( const void (*NewTaskMain)(), byte Priority );
  47.     BOOLEAN  Stop( word timeout=INF );
  48.     BOOLEAN  Resume();
  49.     BOOLEAN  Suspend( word timeout=INF );
  50.     BOOLEAN  IsLocked();
  51.    
  52.    
  53.    //-------- destructor ----------
  54.     ~Task();
  55.  
  56. };
  57.  
  58. #endif
  59. // EOF
  60.