home *** CD-ROM | disk | FTP | other *** search
- /*************************************************************************
- * Copyright (c) 1989-1992 Micro Digital Associates, Inc.
- * All Rights Reserved.
- *
- * MODULE: TASK.HPP
- *
- * DESRIPTION:
- * This is the header file for the task class. It contains the
- * class definition.
- *
- *
- * AUTHOR: Rick Evans
- *
- *
- *************************************************************************/
-
- #ifndef __TASK_HPP
- #define __TASK_HPP 1
-
- #include <xtypes.h>
-
- class Task
- {
-
- TCB_PTR TaskCBP;
-
- public:
- //---- constructors -----
- //Create a task from scatch
- Task( const void(*TaskMain)(), byte priority, word stackSize=0 );
-
- //Copy a existing Task.
- Task( const Task& t );
-
- Task( TCB_PTR p );
-
- //----- methods -----------
- BOOLEAN Hook( const void(*hookMain)() );
- void Lock();
- void UnLock();
- void StackCheckOn();
- void StackCheckOff();
- BOOLEAN Start();
- BOOLEAN Start( word parm );
- BOOLEAN Start( byte Priority );
- BOOLEAN Start( const void (*NewTaskMain)(), byte Priority );
- BOOLEAN Stop( word timeout=INF );
- BOOLEAN Resume();
- BOOLEAN Suspend( word timeout=INF );
- BOOLEAN IsLocked();
-
-
- //-------- destructor ----------
- ~Task();
-
- };
-
- #endif
- // EOF