VR-Forces 4.0.4 Class Documentation
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]

List of all members.

Public Member Functions

 DtTaskMessage ()
 default constructor
 DtTaskMessage (const DtTaskMessage &orig)
virtual ~DtTaskMessage ()
 Destructor; does not destroy task, unless it created it (copy constructor; assignment operator; or setFromNet()).
virtual DtSimTasktask () const
 Returns a pointer to the task this message is conveying.
virtual void setTask (DtSimTask *task)
 N.B.
virtual bool independentlyTasked () const
 Indicates whether task issued intended to be executed independently by the recipient, or as part of an aggregate.
virtual void setIndependentlyTasked (bool yesNo)
virtual int contentCategoryType () const
 Returns the string type identifier for the message type, DtTaskMessageType (defined in taskTypes.h).
virtual int contentType () const
virtual DtSimMessageclone () const
 Required override.
virtual int netRepSize () const
 Overrides the base class DtSimRadioMessage netRepSize().
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.
virtual bool setToNet ()
 Fill in our task type, tell the task to fill itself out, and then copy its buffer into ours.
virtual void printDataToString (DtString &str)
 Print message.
virtual void setTaskId (int id)
 Identifier used to associated task complete the original task message.
virtual int taskId () const
 Identifier used to associated task complete the original task message.
virtual void setSubtaskId (int id)
virtual int subtaskId () const

Static Public Member Functions

static DtVrfObjectMessagecreator ()

Protected Member Functions

const DtTaskMessageoperator= (DtTaskMessage &orig)

Protected Attributes

DtSimTaskmyTask
bool myOwnTask
bool myIndependentlyTasked
int myTaskId

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

default constructor

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); ...

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 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 int DtTaskMessage::contentType ( ) const [virtual]
Returns:
The type of task contained in this message.

Implements DtVrfObjectMessage.

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 DtSimRadioMessage 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.


Member Data Documentation

int DtTaskMessage::myTaskId [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)