![]() |
VR-Forces 4.0.4 Class Documentation
|
DtSimTaskState holds the current execution state of a given task. More...

Public Member Functions | |
| DtSimTaskState () | |
| default constructor | |
| DtSimTaskState (const DtString &writeName, DtReaderWriterRegistry *parentRegistry=0) | |
| constructor If you have a task staet object 'put' itself, the write name will preface the task state object. | |
| DtSimTaskState (const DtString &writeName, const DtSimTaskState &orig, DtReaderWriterRegistry *parentRegistry=0) | |
| copy constructor | |
| const DtSimTaskState & | operator= (const DtSimTaskState &orig) |
| assignment operator; same as copy constructor | |
| virtual | ~DtSimTaskState () |
| destructor | |
| virtual bool | init () |
| Base class init does nothing, but this will be called by create, in case any other deriving class needs to do virtual allocation. | |
| virtual int | type () const |
| What kind of task state object am I? Returns a string indicating the kind of task state object( for example, “move-along-task-state”, Derived classes must implement this member function to return a unique string representing the type of task state. | |
| virtual DtSimTaskState * | clone (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const |
| Make a copy of this task. | |
| virtual void | putData (FILE *fp, int indentLevel=0) |
| putData writes our type, which is provided by the virtual type accessor of the deriving class. | |
| virtual DtlObjPtr | getData (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings) |
| getData is just used to get us past the type in the data stream, since it's not actually stored. | |
Static Public Member Functions | |
| static DtSimTaskState * | createTaskState (DtlObjPtr mtlStream) |
| Static functions. | |
| static DtSimTaskState * | createTaskState (int taskStateType) |
| static void | addTaskStateCreatorFcn (const DtString &taskName, int taskType, DtSimTaskStateCreatorFcn fcn) |
| Adds a task creator member function to the task factory. | |
| static void | setFactory (DtSimTaskStateFactory *factory) |
| static DtSimTaskStateFactory * | factory () |
| static bool | getTaskStateNameFromTaskStateType (int taskStateType, DtString &taskStateName) |
| static bool | getTaskStateTypeFromTaskStateName (const DtString &taskStateName, int &taskStateType) |
Static Public Attributes | |
| static DtSimTaskStateFactory * | myFactory |
DtSimTaskState holds the current execution state of a given task.
DtSimTaskState is an abstract base class that represents the current execution state associated with a given DtSimTask. Derived classes hold details particular to a specific task. For example, for the DtMoveAlongTask there is a corresponding DtMoveAlongTaskState class that holds the current waypoint and direction of movement along the route. DtSimTaskState can be used in transferring responsibility for handling a task from one class to another (i.e. mult-resolution modeling), or in the context of suspending and resuming a task.
default constructor
| DtSimTaskState::DtSimTaskState | ( | const DtString & | writeName, |
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
constructor If you have a task staet object 'put' itself, the write name will preface the task state object.
| DtSimTaskState::DtSimTaskState | ( | const DtString & | writeName, |
| const DtSimTaskState & | orig, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
copy constructor
| virtual DtSimTaskState::~DtSimTaskState | ( | ) | [virtual] |
destructor
| const DtSimTaskState& DtSimTaskState::operator= | ( | const DtSimTaskState & | orig | ) |
assignment operator; same as copy constructor
| virtual bool DtSimTaskState::init | ( | ) | [virtual] |
Base class init does nothing, but this will be called by create, in case any other deriving class needs to do virtual allocation.
| virtual int DtSimTaskState::type | ( | ) | const [virtual] |
What kind of task state object am I? Returns a string indicating the kind of task state object( for example, “move-along-task-state”, Derived classes must implement this member function to return a unique string representing the type of task state.
The set of standard task state types supplied with VR-Forces is in taskStateTypes.h.
Reimplemented in DtPatrolBetweenPointsTaskState, DtPatrolRouteTaskState, DtMoveAlongTaskState, and DtWaitTaskState.
| virtual DtSimTaskState* DtSimTaskState::clone | ( | const DtString & | name, |
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | const [virtual] |
Make a copy of this task.
Returns a newly allocated instance of a DtSimTaskState. Override this member function to return a pointer to a newly allocated instance of the derived class.
Reimplemented in DtPatrolBetweenPointsTaskState, DtPatrolRouteTaskState, DtMoveAlongTaskState, and DtWaitTaskState.
| virtual void DtSimTaskState::putData | ( | FILE * | fp, |
| int | indentLevel = 0 |
||
| ) | [virtual] |
putData writes our type, which is provided by the virtual type accessor of the deriving class.
Reimplemented from DtReaderWriter.
| virtual DtlObjPtr DtSimTaskState::getData | ( | DtlObjPtr | args, |
| const DtFilename & | searchPath, | ||
| const DtVariableBindingsList & | variableBindings | ||
| ) | [virtual] |
getData is just used to get us past the type in the data stream, since it's not actually stored.
| static DtSimTaskState* DtSimTaskState::createTaskState | ( | DtlObjPtr | mtlStream | ) | [static] |
Static functions.
Creates a new task state object, given a pointer to a MÄK Technologies LISP (MTL) stream. It first parses the stream to extract the type of task to create. Then it calls the task factory's create() member function with the given task type. This returns a new instance of the particular task type. The task's getData() member function is then called to retrieve the task parameters from the stream. The pointer to the new task is returned.
| static DtSimTaskState* DtSimTaskState::createTaskState | ( | int | taskStateType | ) | [static] |
| static void DtSimTaskState::addTaskStateCreatorFcn | ( | const DtString & | taskName, |
| int | taskType, | ||
| DtSimTaskStateCreatorFcn | fcn | ||
| ) | [static] |
Adds a task creator member function to the task factory.
| static void DtSimTaskState::setFactory | ( | DtSimTaskStateFactory * | factory | ) | [static] |
| static DtSimTaskStateFactory* DtSimTaskState::factory | ( | ) | [static] |
Reimplemented from DtReaderWriter.
| static bool DtSimTaskState::getTaskStateNameFromTaskStateType | ( | int | taskStateType, |
| DtString & | taskStateName | ||
| ) | [static] |
| static bool DtSimTaskState::getTaskStateTypeFromTaskStateName | ( | const DtString & | taskStateName, |
| int & | taskStateType | ||
| ) | [static] |