VR-Forces 4.10 Class Documentation
 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. More...

Inheritance diagram for DtTaskMessage:
Inheritance graph
[legend]

Public Member Functions

 DtTaskMessage ()
 default constructor More...
 
 DtTaskMessage (const DtTaskMessage &orig)
 
virtual ~DtTaskMessage ()
 Destructor; does not destroy task, unless it created it (copy constructor; assignment operator; or setFromNet()). More...
 
virtual DtSimTasktask () const
 Returns a pointer to the task this message is conveying. More...
 
virtual void setTask (DtSimTask *task)
 N.B. More...
 
void setOwnsTask (bool b)
 Sets whether or not message has ownership of task. If set to true will delete when task message is deleted. More...
 
virtual bool independentlyTasked () const
 Indicates whether task issued intended to be executed independently by the recipient, or as part of an aggregate. More...
 
virtual void setIndependentlyTasked (bool yesNo)
 
virtual int contentCategoryType () const
 Returns the string type identifier for the message type, DtTaskMessageType (defined in taskTypes.h). More...
 
virtual const
DtSimTaskMessageType
contentType () const
 
virtual DtSimMessageclone () const
 Required override. More...
 
virtual int netRepSize () const
 Overrides the base class DtVrfObjectMessage netRepSize(). More...
 
virtual bool setFromNet (const char *networkBuffer, unsigned contentSize)
 Extracts the task type, creates the task (using the task factory), and then tells the task to fill itself in from the network buffer. More...
 
virtual bool setToNet ()
 Fill in our task type, tell the task to fill itself out, and then copy its buffer into ours. More...
 
virtual void printDataToString (DtString &str)
 Print message. More...
 
bool ownsTask () const
 
virtual void setTaskId (int id)
 Identifier used to associated task complete the original task message. More...
 
virtual int taskId () const
 
virtual void setSubtaskId (int id)
 
virtual int subtaskId () const
 
virtual void setTaskTrackingNumber (int n)
 This value is the same as the taskTrackingNumber passed in the original task message that started the task. More...
 
virtual int taskTrackingNumber () const
 
virtual void setAffectsIndependentTaskStatus (bool)
 Sets whether or not this task affects the independent task status (default is true). More...
 
virtual bool affectsIndependentTaskStatus () const
 
- Public Member Functions inherited from DtVrfObjectMessage
 DtVrfObjectMessage ()
 default constructor More...
 
 DtVrfObjectMessage (const DtVrfObjectMessage &orig)
 copy constructor: shallow; copies values only. More...
 
const DtVrfObjectMessageoperator= (const DtVrfObjectMessage &orig)
 assignment operator: shallow; assigns values only. More...
 
virtual ~DtVrfObjectMessage ()
 destructor More...
 
virtual int messageType () const
 
virtual int radioMessageType () const
 
virtual charnetRep ()
 Returns a pointer to the simulation network representation of this message. More...
 
virtual int scenarioRunId () const
 If used, the scenario run id of the scenario that sent this message. More...
 
virtual void setScenarioRunId (int)
 
virtual void setReceiver (const DtUUID &receiver)
 Note that sending/receiving by echelon id is no longer supported. More...
 
virtual const DtUUIDreceiver () const
 
virtual void setRecipient (const DtUUID &receiver)
 
virtual const DtUUIDrecipient () const
 
virtual void setTransmitter (const DtUUID &transmitter)
 Note that sending/receiving by echelon id is no longer supported. More...
 
virtual const DtUUIDtransmitter () const
 
virtual void setSender (const DtUUID &transmitter)
 
virtual const DtUUIDsender () const
 
- Public Member Functions inherited from DtSimMessage
 DtSimMessage ()
 default constructor More...
 
 DtSimMessage (const DtSimMessage &orig)
 copy constructor More...
 
const DtSimMessageoperator= (const DtSimMessage &orig)
 assignment operator More...
 
virtual ~DtSimMessage ()
 destructor More...
 
virtual std::string debugText () const
 Leak detector output. More...
 

Static Public Member Functions

static DtVrfObjectMessagecreator ()
 
- Static Public Member Functions inherited from DtVrfObjectMessage
static DtVrfObjectMessagecreateVrfObjectMessage (int type)
 Creates a new DtVrfObjectMessage subclass using the static factory. More...
 
static DtVrfObjectMessagecreateRadioMessage (int type)
 
static void addVrfObjectMessageCreatorFcn (int type, DtVrfObjectMessageCreatorFcn fcn)
 Adds a new creator function to the DtVrfObjectMessageFactory. More...
 
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
 This is a number that may be provided by the sender of the task, and is then included in the task complete message. More...
 
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
 

Detailed Description

A DtTaskMsg is a DtRadioMsg with a pointer to a task.

The type of the taskMsg is just the type of the task.

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
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
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
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
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 Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)