![]() |
VR-Forces 5.0.1 Developer's Guide
|
A DtReportMessage is a DtVrfObjectMessage 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).

Public Member Functions | |
| DtReportMessage () | |
| DtReportMessage (const DtReportMessage &orig) | |
| virtual | ~DtReportMessage () |
| virtual DtSimReport * | report () const |
| virtual void | setReport (DtSimReport *report) |
| virtual int | contentCategoryType () const |
| virtual const DtSimReportMessageType & | contentType () const |
| virtual DtSimMessage * | clone () const |
| virtual int | netRepSize () const |
| virtual bool | setFromNet (const char *networkBuffer, unsigned contentSize) |
| virtual bool | setToNet () |
| virtual void | printDataToString (DtString &str) |
Static Public Member Functions | |
| static DtVrfObjectMessage * | creator () |
Protected Member Functions | |
| const DtReportMessage & | operator= (DtReportMessage &orig) |
Protected Attributes | |
| DtSimReport * | myReport |
| bool | myOwnReport |
Additional Inherited Members |
| DtReportMessage::DtReportMessage | ( | ) |
constructor
| DtReportMessage::DtReportMessage | ( | const DtReportMessage & | orig | ) |
|
virtual |
Destructor; does not destroy task, just the message itself.
|
protected |
|
virtual |
Returns a pointer to the DtSimReport object in the message.
|
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 |
The radioMessageType() for this kind of message is DtReportMessageType.
Implements DtVrfObjectMessage.
|
virtual |
|
virtual |
Required override. Clones itself and the task it points to.
Implements DtSimMessage.
|
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 |
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 |
Fill in our task type, tell the task to fill itself out, and then copy its buffer into ours.
Reimplemented from DtVrfObjectMessage.
|
virtual |
Print message.
Reimplemented from DtVrfObjectMessage.
|
static |
|
protected |
|
protected |