home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-08 | 1.3 KB | 59 lines | [TEXT/CWIE] |
- // TaskStep.h
-
- #ifndef TaskStep_h
- #define TaskStep_h
-
- #ifndef Assert_h
- #include "Assert.h"
- #endif
-
- class Task;
-
- template < class Sequence >
- class TaskStep
- {
- friend class TaskSequencer<Sequence>;
-
- public:
- typedef TaskStep<Sequence> (Sequence::*DeferredType)( bool dying, DeferredTaskTime );
- typedef TaskStep<Sequence> (Sequence::*ApplicationType)( bool dying, ApplicationTime );
-
- private:
- ::Task *task;
- DeferredType deferred;
- ApplicationType application;
-
- TaskStep() : task( 0 ), deferred(0), application(0) {}
-
- public:
- TaskStep( ::Task *theTask, DeferredType method )
- : task( theTask ),
- deferred( method ),
- application( 0 )
- {}
-
- TaskStep( ::Task *theTask, ApplicationType method )
- : task( theTask ),
- deferred( 0 ),
- application( method )
- {}
-
- explicit TaskStep( ::Task *theTask )
- : task( theTask ),
- deferred( 0 ),
- application( 0 )
- {}
-
- ::Task *Task() const { return task; }
-
- bool IsDeferred() const { return deferred != 0; }
- bool IsApplication() const { return application != 0; }
-
- bool IsLast() const { return !IsDeferred() && !IsApplication(); }
-
- DeferredType DeferredMethod() const { return deferred; }
- ApplicationType ApplicationMethod() const { return application; }
- };
-
- #endif
-