![]() |
VR-Forces 4.0.4 Class Documentation
|
DtSimTask is an abstract base class from which real tasks can derive. More...

Public Member Functions | |
| virtual | ~DtSimTask () |
| 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 =0 |
| What kind of task am I? Returns a string indicating the kind of task (for example, “move-to”, “follow-entity”). | |
| virtual DtSimTask * | clone (const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const =0 |
| Make a copy of this task. | |
| virtual DtString | stringRep () const =0 |
| Returns a human-readable string representation of the task. | |
| virtual void | setSubtask (bool flag) |
| If true, this task is a subtask. | |
| virtual bool | subtask () const |
| 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. | |
| virtual char * | netRep () |
| virtual int | netRepSize () const |
| Returns the size in bytes of the network representation of the class. | |
| virtual bool | setFromNet (const char *contentBuffer, unsigned contentSize) |
| Sets mySubtask member from the incoming contentBuffer (cast to type DtNetSimTask). | |
| virtual bool | setToNet () |
| Calls netRep() to create the network buffer. | |
Static Public Member Functions | |
| static DtSimTask * | createTask (DtlObjPtr mtlStream) |
| Static functions. | |
| static DtSimTask * | createTask (int taskType) |
| static void | addTaskCreatorFcn (const DtString &taskName, int taskType, DtSimTaskCreatorFcn fcn) |
| Adds a task creator member function to the task factory. | |
| static void | setFactory (DtSimTaskFactory *factory) |
| static DtSimTaskFactory * | factory () |
| static bool | getTaskNameFromTaskType (int taskType, DtString &taskName) |
| static bool | getTaskTypeFromTaskName (const DtString &taskName, int &taskType) |
Protected Member Functions | |
| DtSimTask () | |
| Constructors are protected because no one should instantiate the base class, just derived versions. | |
| DtSimTask (const DtString &writeName, DtReaderWriterRegistry *parentRegistry=0) | |
| constructor If you have a task 'put' itself, the write name will preface the task. | |
| DtSimTask (const DtString &writeName, const DtSimTask &orig, DtReaderWriterRegistry *parentRegistry=0) | |
| copy constructor | |
| const DtSimTask & | operator= (const DtSimTask &orig) |
| assignment operator; same as copy constructor | |
| virtual char * | createNetworkBuffer () |
Protected Attributes | |
| DtRwBoolean | mySubtask |
| char * | myNetRep |
Static Protected Attributes | |
| static DtSimTaskFactory * | myFactory |
DtSimTask is an abstract base class from which real tasks can derive.
It manages the read/write capability; derived classes need only use and register read/writatble data types for derived information.
| DtSimTask::DtSimTask | ( | ) | [protected] |
Constructors are protected because no one should instantiate the base class, just derived versions.
default constructor
| DtSimTask::DtSimTask | ( | const DtString & | writeName, |
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [protected] |
constructor If you have a task 'put' itself, the write name will preface the task.
| DtSimTask::DtSimTask | ( | const DtString & | writeName, |
| const DtSimTask & | orig, | ||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | [protected] |
copy constructor
| virtual DtSimTask::~DtSimTask | ( | ) | [virtual] |
destructor
assignment operator; same as copy constructor
| virtual bool DtSimTask::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 DtSimTask::type | ( | ) | const [pure virtual] |
What kind of task am I? Returns a string indicating the kind of task (for example, “move-to”, “follow-entity”).
Derived classes must implement this member function to return a unique string representing the type of task. The set of standard task types supplied with VR-Forces is in taskTypes.h.
Implemented in DtFlyHeadingAndAltitudeTask, DtFlyHeadingTask, DtFollowEntityTask, DtFlyAlongTask, DtMoveAlongTask, DtPatrolRouteTask, BHAVE::DtBhaveTask, DtPatrolTwoPointsTask, DtUserTask, DtMoveToTask, DtEmbarkTask, DtRailMoveAlongTask, DtLandingTask, DtTakeoffTask, DtWaitElapsedTask, DtMoveToAltitudeTask, DtFlyToLocationTask, DtRailPathTask, DtRailRouteTask, DtTargetPointTask, DtWaitDurationTask, DtTurnToHeadingTask, DtWaitTask, DtBreachTask, DtConvoyAlongTask, DtConvoyToTask, DtMoveToLocationTask, DtOrbitTask, DtDisembarkTask, DtFireForEffectOnEntityTask, DtFireForEffectOnTargetTask, DtTargetEntityTask, DtFireForEffectOnLocationTask, DtPlanAndMoveToLocationTask, DtPlanAndMoveToTask, DtLaseTargetTask, DtLaunchExpendableResourceTask, DtCrashIntoTask, DtFireCruiseMissileTask, DtVerticalLandingTask, DtStopMovingTask, DtDisembarkAllTask, DtMoveIntoFormationTask, DtRetreatTask, DtInterceptAndDestroyTask, DtSendSetMessageTask, DtSendTaskMessageTask, DtLaunchSmokeTask, DtSendTextTask, DtFireAtTargetTask, DtDiGuyAnimationTask, and DtFlyAltitudeTask.
| virtual DtSimTask* DtSimTask::clone | ( | const DtString & | name, |
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) | const [pure virtual] |
Make a copy of this task.
Returns a newly allocated instance of a DtSimTask. Override this member function to return a pointer to a newly allocated instance of the derived class.
Implemented in DtFlyHeadingAndAltitudeTask, DtFlyHeadingTask, DtFollowEntityTask, DtFlyAlongTask, DtMoveAlongTask, DtPatrolRouteTask, BHAVE::DtBhaveTask, DtPatrolTwoPointsTask, DtEmbarkTask, DtUserTask, DtMoveToTask, DtLandingTask, DtRailMoveAlongTask, DtTakeoffTask, DtWaitElapsedTask, DtMoveToAltitudeTask, DtFlyToLocationTask, DtRailPathTask, DtRailRouteTask, DtTargetPointTask, DtWaitDurationTask, DtTurnToHeadingTask, DtWaitTask, DtBreachTask, DtConvoyAlongTask, DtConvoyToTask, DtDisembarkTask, DtMoveToLocationTask, DtOrbitTask, DtFireForEffectOnEntityTask, DtFireForEffectOnTargetTask, DtTargetEntityTask, DtFireForEffectOnLocationTask, DtPlanAndMoveToLocationTask, DtPlanAndMoveToTask, DtLaseTargetTask, DtLaunchExpendableResourceTask, DtCrashIntoTask, DtFireCruiseMissileTask, DtVerticalLandingTask, DtStopMovingTask, DtDisembarkAllTask, DtMoveIntoFormationTask, DtDiGuyAnimationTask, DtRetreatTask, DtInterceptAndDestroyTask, DtSendSetMessageTask, DtSendTaskMessageTask, DtLaunchSmokeTask, DtSendTextTask, DtFireAtTargetTask, and DtFlyAltitudeTask.
Referenced by BHAVE::BHAVE3DGui::DtCreateItemData::DtCreateItemData(), and BHAVE::BHAVE3DGui::DtCreateItemData::operator=().
| virtual DtString DtSimTask::stringRep | ( | ) | const [pure virtual] |
Returns a human-readable string representation of the task.
This string representation is used to display information about the task in the plan editor and viewer. The type and parameters for the task are typically encoded in the string. The format of the string is up to you.
Implemented in DtFlyHeadingAndAltitudeTask, DtFlyHeadingTask, DtFollowEntityTask, DtFlyAlongTask, DtMoveAlongTask, DtPatrolRouteTask, BHAVE::DtBhaveTask, DtEmbarkTask, DtPatrolTwoPointsTask, DtMoveToTask, DtUserTask, DtLandingTask, DtTakeoffTask, DtRailMoveAlongTask, DtWaitElapsedTask, DtMoveToAltitudeTask, DtFlyToLocationTask, DtTargetPointTask, DtDisembarkTask, DtRailPathTask, DtRailRouteTask, DtWaitDurationTask, DtTurnToHeadingTask, DtWaitTask, DtBreachTask, DtConvoyAlongTask, DtConvoyToTask, DtMoveToLocationTask, DtOrbitTask, DtFireForEffectOnEntityTask, DtFireForEffectOnTargetTask, DtTargetEntityTask, DtFireForEffectOnLocationTask, DtPlanAndMoveToLocationTask, DtPlanAndMoveToTask, DtLaseTargetTask, DtLaunchExpendableResourceTask, DtCrashIntoTask, DtFireCruiseMissileTask, DtVerticalLandingTask, DtSendSetMessageTask, DtSendTaskMessageTask, DtStopMovingTask, DtDisembarkAllTask, DtMoveIntoFormationTask, DtRetreatTask, DtInterceptAndDestroyTask, DtLaunchSmokeTask, DtSendTextTask, DtFireAtTargetTask, DtDiGuyAnimationTask, and DtFlyAltitudeTask.
| virtual void DtSimTask::setSubtask | ( | bool | flag | ) | [virtual] |
If true, this task is a subtask.
This will keep taskNotify from clearing the currently executing task, and prevent a request of a new task from the plan manager when this task completes
| virtual bool DtSimTask::subtask | ( | ) | const [virtual] |
| virtual void DtSimTask::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.
Reimplemented in DtSendSetMessageTask, and DtSendTaskMessageTask.
| virtual DtlObjPtr DtSimTask::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.
Reimplemented in DtSendSetMessageTask, and DtSendTaskMessageTask.
| virtual char* DtSimTask::netRep | ( | ) | [virtual] |
| virtual int DtSimTask::netRepSize | ( | ) | const [virtual] |
Returns the size in bytes of the network representation of the class.
This is the size in bytes of the DtNetSimTask structure. Derived classes should take into acount the size returned by this class when overriding (they should call down to this class and add the result to their additional size).
Reimplemented in DtFlyHeadingAndAltitudeTask, DtFlyHeadingTask, DtFlyAlongTask, DtMoveAlongTask, DtFollowEntityTask, DtUserTask, DtEmbarkTask, DtRailPathTask, DtMoveToTask, DtBreachTask, DtPatrolTwoPointsTask, DtLandingTask, DtPatrolRouteTask, DtTakeoffTask, DtFireForEffectTask, DtRailMoveAlongTask, DtRailRouteTask, DtFireCruiseMissileTask, DtMoveToLocationTask, DtOrbitTask, DtWaitElapsedTask, DtFlyToLocationTask, DtMoveToAltitudeTask, DtTargetPointTask, DtConvoyToTask, DtLaunchExpendableResourceTask, DtWaitDurationTask, DtDisembarkTask, DtFireForEffectOnEntityTask, DtFireAtTargetTask, DtTurnToHeadingTask, DtConvoyAlongTask, DtFireForEffectOnTargetTask, DtMoveIntoFormationTask, DtWaitTask, DtFireForEffectOnLocationTask, DtLaseTargetTask, DtTargetEntityTask, DtCrashIntoTask, DtVerticalLandingTask, DtRetreatTask, DtLaunchSmokeTask, DtInterceptAndDestroyTask, DtSendSetMessageTask, DtSendTaskMessageTask, DtStopMovingTask, DtDisembarkAllTask, DtSendTextTask, DtFlyAltitudeTask, and DtDiGuyAnimationTask.
| virtual bool DtSimTask::setFromNet | ( | const char * | contentBuffer, |
| unsigned | contentSize | ||
| ) | [virtual] |
Sets mySubtask member from the incoming contentBuffer (cast to type DtNetSimTask).
Derived classes should call down to this function first, and then extract their own data starting at the location contentBuffer + DtSimTask::netRepSize().
Reimplemented in DtFlyHeadingAndAltitudeTask, DtFlyHeadingTask, DtFlyAlongTask, DtMoveAlongTask, DtFollowEntityTask, DtUserTask, DtEmbarkTask, DtRailPathTask, DtLandingTask, DtMoveToTask, DtTakeoffTask, DtBreachTask, DtPatrolTwoPointsTask, DtPatrolRouteTask, DtFireForEffectTask, DtRailMoveAlongTask, DtRailRouteTask, DtFireCruiseMissileTask, DtMoveToLocationTask, DtOrbitTask, DtWaitElapsedTask, DtFlyToLocationTask, DtMoveToAltitudeTask, DtTargetPointTask, DtConvoyToTask, DtDisembarkTask, DtWaitDurationTask, DtFireForEffectOnEntityTask, DtFireAtTargetTask, DtTurnToHeadingTask, DtConvoyAlongTask, DtFireForEffectOnTargetTask, DtLaunchExpendableResourceTask, DtMoveIntoFormationTask, DtWaitTask, DtFireForEffectOnLocationTask, DtLaseTargetTask, DtTargetEntityTask, DtCrashIntoTask, DtVerticalLandingTask, DtRetreatTask, DtLaunchSmokeTask, DtInterceptAndDestroyTask, DtSendSetMessageTask, DtSendTaskMessageTask, DtStopMovingTask, DtDisembarkAllTask, DtSendTextTask, DtFlyAltitudeTask, and DtDiGuyAnimationTask.
| virtual bool DtSimTask::setToNet | ( | ) | [virtual] |
Calls netRep() to create the network buffer.
Casts the resulting myNetRep to type DtNetSimTask*, and then sets the mySubtask member in the DtNetSimTask from mySubtask. Derived classes should call down to the base class version of setToNet() at the start of the function (before doing any processing on the network representation) They can then start to fill in their network data, starting at the location myNetRep + DtSimTask::netRepSize().
Reimplemented in DtFlyHeadingAndAltitudeTask, DtFlyHeadingTask, DtFlyAlongTask, DtMoveAlongTask, DtFollowEntityTask, DtUserTask, DtEmbarkTask, DtLandingTask, DtTakeoffTask, DtMoveToTask, DtBreachTask, DtPatrolTwoPointsTask, DtPatrolRouteTask, DtRailPathTask, DtFireForEffectTask, DtRailMoveAlongTask, DtFireCruiseMissileTask, DtFlyToLocationTask, DtMoveToLocationTask, DtOrbitTask, DtRailRouteTask, DtWaitElapsedTask, DtMoveToAltitudeTask, DtDisembarkTask, DtTargetPointTask, DtConvoyToTask, DtWaitDurationTask, DtFireForEffectOnEntityTask, DtFireAtTargetTask, DtTurnToHeadingTask, DtConvoyAlongTask, DtFireForEffectOnTargetTask, DtMoveIntoFormationTask, DtWaitTask, DtFireForEffectOnLocationTask, DtLaseTargetTask, DtTargetEntityTask, DtLaunchExpendableResourceTask, DtCrashIntoTask, DtVerticalLandingTask, DtRetreatTask, DtLaunchSmokeTask, DtInterceptAndDestroyTask, DtStopMovingTask, DtSendSetMessageTask, DtSendTaskMessageTask, DtDisembarkAllTask, DtSendTextTask, DtFlyAltitudeTask, and DtDiGuyAnimationTask.
| static DtSimTask* DtSimTask::createTask | ( | DtlObjPtr | mtlStream | ) | [static] |
Static functions.
Creates a new task, 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 DtSimTask* DtSimTask::createTask | ( | int | taskType | ) | [static] |
| static void DtSimTask::addTaskCreatorFcn | ( | const DtString & | taskName, |
| int | taskType, | ||
| DtSimTaskCreatorFcn | fcn | ||
| ) | [static] |
Adds a task creator member function to the task factory.
| static void DtSimTask::setFactory | ( | DtSimTaskFactory * | factory | ) | [static] |
| static DtSimTaskFactory* DtSimTask::factory | ( | ) | [static] |
Reimplemented from DtReaderWriter.
| static bool DtSimTask::getTaskNameFromTaskType | ( | int | taskType, |
| DtString & | taskName | ||
| ) | [static] |
| static bool DtSimTask::getTaskTypeFromTaskName | ( | const DtString & | taskName, |
| int & | taskType | ||
| ) | [static] |
| virtual char* DtSimTask::createNetworkBuffer | ( | ) | [protected, virtual] |
DtRwBoolean DtSimTask::mySubtask [protected] |
char* DtSimTask::myNetRep [protected] |
DtSimTaskFactory* DtSimTask::myFactory [static, protected] |