VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtTaskMessage Class Reference

A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the task.

Related Examples

Inheritance diagram for DtTaskMessage:
Inheritance graph
[legend]

Public Member Functions

 DtTaskMessage ()
 
 DtTaskMessage (const DtTaskMessage &orig)
 
virtual ~DtTaskMessage ()
 
virtual DtSimTasktask () const
 
virtual void setTask (DtSimTask *task)
 
void setOwnsTask (bool b)
 
virtual bool independentlyTasked () const
 
virtual void setIndependentlyTasked (bool yesNo)
 
virtual int contentCategoryType () const
 
virtual const
DtSimTaskMessageType
contentType () const
 
virtual DtSimMessageclone () const
 
virtual int netRepSize () const
 
virtual bool setFromNet (const char *networkBuffer, unsigned contentSize)
 
virtual bool setToNet ()
 
virtual void printDataToString (DtString &str)
 
bool ownsTask () const
 
virtual void setTaskId (int id)
 
virtual int taskId () const
 
virtual void setSubtaskId (int id)
 
virtual int subtaskId () const
 
virtual void setTaskTrackingNumber (int n)
 
virtual int taskTrackingNumber () const
 
virtual void setAffectsIndependentTaskStatus (bool)
 
virtual bool affectsIndependentTaskStatus () const
 
- Public Member Functions inherited from DtVrfObjectMessage
 DtVrfObjectMessage ()
 
 DtVrfObjectMessage (const DtVrfObjectMessage &orig)
 
const DtVrfObjectMessageoperator= (const DtVrfObjectMessage &orig)
 
virtual ~DtVrfObjectMessage ()
 
virtual int messageType () const
 
virtual int radioMessageType () const
 
virtual charnetRep ()
 
virtual int scenarioRunId () const
 
virtual void setScenarioRunId (int)
 
virtual void setReceiver (const DtUUID &receiver)
 
virtual const DtUUIDreceiver () const
 
virtual void setRecipient (const DtUUID &receiver)
 
virtual const DtUUIDrecipient () const
 
virtual void setTransmitter (const DtUUID &transmitter)
 
virtual const DtUUIDtransmitter () const
 
virtual void setSender (const DtUUID &transmitter)
 
virtual const DtUUIDsender () const
 
- Public Member Functions inherited from DtSimMessage
 DtSimMessage ()
 
 DtSimMessage (const DtSimMessage &orig)
 
const DtSimMessageoperator= (const DtSimMessage &orig)
 
virtual ~DtSimMessage ()
 
virtual std::string debugText () const
 

Static Public Member Functions

static DtVrfObjectMessagecreator ()
 
- Static Public Member Functions inherited from DtVrfObjectMessage
static DtVrfObjectMessagecreateVrfObjectMessage (int type)
 
static DtVrfObjectMessagecreateRadioMessage (int type)
 
static void addVrfObjectMessageCreatorFcn (int type, DtVrfObjectMessageCreatorFcn fcn)
 
static void addRadioMessageCreatorFcn (int type, DtVrfObjectMessageCreatorFcn fcn)
 
static void setFactory (DtVrfObjectMessageFactory *factory)
 
static DtVrfObjectMessageFactoryfactory ()
 

Protected Member Functions

const DtTaskMessageoperator= (DtTaskMessage &orig)
 
- Protected Member Functions inherited from DtVrfObjectMessage
virtual charcreateNetworkBuffer ()
 

Protected Attributes

DtSimTaskmyTask
 
bool myOwnTask
 
bool myIndependentlyTasked
 
int myTaskId
 
int myTaskTrackingNumber
 
bool myAffectsIndependentTaskStatus
 
- Protected Attributes inherited from DtVrfObjectMessage
DtUUID myTransmitter
 
DtUUID myReceiver
 
charmyNetRep
 
int myScenarioRunId
 

Additional Inherited Members

- Static Protected Attributes inherited from DtVrfObjectMessage
static DtVrfObjectMessageFactorymyFactory
 

Constructor & Destructor Documentation

DtTaskMessage::DtTaskMessage ( )

default constructor

DtTaskMessage::DtTaskMessage ( const DtTaskMessage orig)
virtual DtTaskMessage::~DtTaskMessage ( )
virtual

Destructor; does not destroy task, unless it created it (copy constructor; assignment operator; or setFromNet()).

Member Function Documentation

const DtTaskMessage& DtTaskMessage::operator= ( DtTaskMessage orig)
protected
virtual DtSimTask* DtTaskMessage::task ( ) const
virtual

Returns a pointer to the task this message is conveying.

virtual void DtTaskMessage::setTask ( DtSimTask task)
virtual

N.B.: This function USED TO clone the task passed as an argument. However, for performance reasons, it has been modified to just keep a pointer to the task. This means that it is the caller's responsibility to ensure that the lifetime of the task goes beyond the lifetime of the message. For example, this previously acceptable code will now FAIL:

DtSimTask* task = new DtMoveToTask; DtTaskMessage* message = new DtTaskMessage; task->setControlPtName("A Waypoint"); message->setTask(task); delete task; vrfObject()->radio()->sendToNet(message); ...

void DtTaskMessage::setOwnsTask ( bool  b)
inline

Sets whether or not message has ownership of task. If set to true will delete when task message is deleted.

virtual bool DtTaskMessage::independentlyTasked ( ) const
virtual

Indicates whether task issued intended to be executed independently by the recipient, or as part of an aggregate.

virtual void DtTaskMessage::setIndependentlyTasked ( bool  yesNo)
virtual
virtual void DtTaskMessage::setTaskId ( int  id)
virtual

Identifier used to associated task complete the original task message. Each task gets a task ID when it starts being executed. The user should never have to set this manually.

virtual int DtTaskMessage::taskId ( ) const
virtual

Identifier used to associated task complete the original task message. Each task gets a task ID when it starts being executed. The user should never have to set this manually.

virtual void DtTaskMessage::setSubtaskId ( int  id)
virtual
Deprecated:
As of VR-Forces 3.12. Call setTaskId() and taskId() instead.
virtual int DtTaskMessage::subtaskId ( ) const
virtual
Deprecated:
As of VR-Forces 3.12. Call setTaskId() and taskId() instead.
virtual void DtTaskMessage::setTaskTrackingNumber ( int  n)
virtual

This value is the same as the taskTrackingNumber passed in the original task message that started the task. This is designed for uses such as an aggregate starting issuing tasks to a subordinate, and providing unique identifiers to the tasks so their completion can be tracked.

Note
This is different from taskId, since taskId is assigned by the entity carrying out the task, can cannot be known at the time of issuing the task.
virtual int DtTaskMessage::taskTrackingNumber ( ) const
virtual

This value is the same as the taskTrackingNumber passed in the original task message that started the task. This is designed for uses such as an aggregate starting issuing tasks to a subordinate, and providing unique identifiers to the tasks so their completion can be tracked.

Note
This is different from taskId, since taskId is assigned by the entity carrying out the task, can cannot be known at the time of issuing the task.
virtual void DtTaskMessage::setAffectsIndependentTaskStatus ( bool  )
virtual

Sets whether or not this task affects the independent task status (default is true). A task that is should not affect whether or not an entity is independently tasked (given its current status) should set this value to false.

virtual bool DtTaskMessage::affectsIndependentTaskStatus ( ) const
virtual

Sets whether or not this task affects the independent task status (default is true). A task that is should not affect whether or not an entity is independently tasked (given its current status) should set this value to false.

virtual int DtTaskMessage::contentCategoryType ( ) const
virtual

Returns the string type identifier for the message type, DtTaskMessageType (defined in taskTypes.h). If you override this class, you should override this member function to return its own unique string type.

Implements DtVrfObjectMessage.

virtual const DtSimTaskMessageType& DtTaskMessage::contentType ( ) const
virtual
Returns
The type of task contained in this message.
virtual DtSimMessage* DtTaskMessage::clone ( ) const
virtual

Required override. Clones itself and the task it points to. Returns a newly created copy of itself. The contents of the class are cloned from this instance, including the task it contains. Derived classes should override this member function to return a cloned copy of the derived type.

Implements DtSimMessage.

virtual int DtTaskMessage::netRepSize ( ) const
virtual

Overrides the base class DtVrfObjectMessage netRepSize(). This calls down to the base class to get the size of the header created by the base, and then adds any task, set data, or report contents.

Reimplemented from DtVrfObjectMessage.

virtual bool DtTaskMessage::setFromNet ( const char networkBuffer,
unsigned  contentSize 
)
virtual

Extracts the task type, creates the task (using the task factory), and then tells the task to fill itself in from the network buffer.

Reimplemented from DtVrfObjectMessage.

virtual bool DtTaskMessage::setToNet ( )
virtual

Fill in our task type, tell the task to fill itself out, and then copy its buffer into ours.

Reimplemented from DtVrfObjectMessage.

virtual void DtTaskMessage::printDataToString ( DtString str)
virtual

Print message.

Reimplemented from DtVrfObjectMessage.

static DtVrfObjectMessage* DtTaskMessage::creator ( )
static
bool DtTaskMessage::ownsTask ( ) const
inline

Member Data Documentation

DtSimTask* DtTaskMessage::myTask
protected
bool DtTaskMessage::myOwnTask
protected
bool DtTaskMessage::myIndependentlyTasked
protected
int DtTaskMessage::myTaskId
protected
int DtTaskMessage::myTaskTrackingNumber
protected

This is a number that may be provided by the sender of the task, and is then included in the task complete message.

bool DtTaskMessage::myAffectsIndependentTaskStatus
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)