VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtReportMessage Class Reference

A DtReportMessage is a DtRadioMsg with a pointer to a report. More...

Inheritance diagram for DtReportMessage:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtReportMessage ()
 constructor
 DtReportMessage (const DtReportMessage &orig)
virtual ~DtReportMessage ()
 Destructor; does not destroy task, just the message itself.
virtual DtSimReportreport () const
 Returns a pointer to the DtSimReport object in the message.
virtual void setReport (DtSimReport *report)
 N.B.
virtual int contentCategoryType () const
 The radioMessageType() for this kind of message is DtReportMessageType.
virtual int contentType () const
virtual DtSimMessageclone () const
 Required override. Clones itself and the task it points to.
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.

Static Public Member Functions

static DtSimRadioMessagecreator ()

Protected Member Functions

const DtReportMessageoperator= (DtReportMessage &orig)

Protected Attributes

DtSimReportmyReport
bool myOwnReport

Detailed Description

A DtReportMessage is a DtRadioMsg with a pointer to a report.

The type of the reportMsg is just the type of the report. In VR-Forces, only the “task-complete” type (DtTaskCompletedReportType) of DtSimReport is implemented, however you can create your own reports by deriving from DtSimReport and implementing the clone() and type() functions. The DtTaskCompletedReportType report message is sent by taskComplete() to notify either the entity's superior or the DtSimManager of task completion (depending on who issued the task in the first place).


Constructor & Destructor Documentation

constructor

virtual DtReportMessage::~DtReportMessage ( ) [virtual]

Destructor; does not destroy task, just the message itself.


Member Function Documentation

const DtReportMessage& DtReportMessage::operator= ( DtReportMessage orig) [protected]
virtual DtSimReport* DtReportMessage::report ( ) const [virtual]

Returns a pointer to the DtSimReport object in the message.

virtual void DtReportMessage::setReport ( DtSimReport report) [virtual]

N.B.

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

DtSimReport* report = new DtTaskCompleteReport; DtReportMessage* message = new DtReportMessage; report->setTaskCompleted(DtMoveToType); message->setReport(report); delete report; vrfObject->radio()->sendToNet(message); ...

virtual int DtReportMessage::contentCategoryType ( ) const [virtual]

The radioMessageType() for this kind of message is DtReportMessageType.

Implements DtVrfObjectMessage.

virtual int DtReportMessage::contentType ( ) const [virtual]
Returns:
The type of report contained in this message.

Implements DtVrfObjectMessage.

virtual DtSimMessage* DtReportMessage::clone ( ) const [virtual]

Required override. Clones itself and the task it points to.

Implements DtSimMessage.

virtual int DtReportMessage::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 DtReportMessage::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 DtReportMessage::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 DtReportMessage::printDataToString ( DtString str) [virtual]

Print message.

Reimplemented from DtVrfObjectMessage.


Member Data Documentation


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)