VR-Forces 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
DtReportMessage Class Reference

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

Related Examples
Inheritance diagram for DtReportMessage:
Inheritance graph
[legend]

Public Member Functions

 DtReportMessage ()
 
 DtReportMessage (const DtReportMessage &orig)
 
virtual ~DtReportMessage () override
 
virtual DtSimReport * report () const
 
virtual void setReport (DtSimReport *report)
 
virtual int contentCategoryType () const override
 
virtual const
DtSimReportMessageType & 
contentType () const
 
virtual DtSimMessage * clone () const override
 
virtual int netRepSize () const override
 
virtual bool setFromNet (const char *networkBuffer, unsigned contentSize) override
 
virtual bool setToNet () override
 
virtual void printDataToString (DtString &str) override
 
- Public Member Functions inherited from DtVrfObjectMessage
 DtVrfObjectMessage ()
 
 DtVrfObjectMessage (const DtVrfObjectMessage &orig)
 
const DtVrfObjectMessage & operator= (const DtVrfObjectMessage &orig)
 
virtual ~DtVrfObjectMessage () override
 
virtual int messageType () const override
 
virtual int radioMessageType () const
 
virtual char * netRep ()
 
virtual const DtUUID & scenarioRunId () const
 
virtual void setScenarioRunId (const DtUUID &)
 
virtual void setReceiver (const DtUUID &receiver)
 
virtual const DtUUID & receiver () const
 
virtual void setRecipient (const DtUUID &receiver)
 
virtual const DtUUID & recipient () const
 
virtual void setTransmitter (const DtUUID &transmitter)
 
virtual const DtUUID & transmitter () const
 
virtual void setSender (const DtUUID &transmitter)
 
virtual const DtUUID & sender () const
 
- Public Member Functions inherited from DtSimMessage
 DtSimMessage ()
 
 DtSimMessage (const DtSimMessage &orig)
 
const DtSimMessage & operator= (const DtSimMessage &orig)
 
virtual ~DtSimMessage ()
 
virtual std::string debugText () const
 

Static Public Member Functions

static DtVrfObjectMessage * creator ()
 
- Static Public Member Functions inherited from DtVrfObjectMessage
static DtVrfObjectMessage * createVrfObjectMessage (int type)
 
static DtVrfObjectMessage * createRadioMessage (int type)
 
static void addVrfObjectMessageCreatorFcn (int type, DtVrfObjectMessageCreatorFcn fcn)
 
static void addRadioMessageCreatorFcn (int type, DtVrfObjectMessageCreatorFcn fcn)
 
static void setFactory (DtVrfObjectMessageFactory *factory)
 
static DtVrfObjectMessageFactory * factory ()
 

Protected Member Functions

const DtReportMessage & operator= (DtReportMessage &orig)
 
- Protected Member Functions inherited from DtVrfObjectMessage
virtual char * createNetworkBuffer ()
 

Protected Attributes

DtSimReport * myReport
 
bool myOwnReport
 
- Protected Attributes inherited from DtVrfObjectMessage
DtUUID myTransmitter
 
DtUUID myReceiver
 
char * myNetRep
 
DtUUID myScenarioRunId
 

Additional Inherited Members

- Static Protected Attributes inherited from DtVrfObjectMessage
static DtVrfObjectMessageFactory * myFactory
 

Constructor & Destructor Documentation

DtReportMessage::DtReportMessage ( )

constructor

DtReportMessage::DtReportMessage ( const DtReportMessage &  orig)
virtual DtReportMessage::~DtReportMessage ( )
overridevirtual

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
overridevirtual

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

Implements DtVrfObjectMessage.

virtual const DtSimReportMessageType& DtReportMessage::contentType ( ) const
virtual
Returns
The type of report contained in this message.
virtual DtSimMessage* DtReportMessage::clone ( ) const
overridevirtual

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

Implements DtSimMessage.

virtual int DtReportMessage::netRepSize ( ) const
overridevirtual

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 DtReportMessage::setFromNet ( const char *  networkBuffer,
unsigned  contentSize 
)
overridevirtual

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 ( )
overridevirtual

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)
overridevirtual

Print message.

Reimplemented from DtVrfObjectMessage.

static DtVrfObjectMessage* DtReportMessage::creator ( )
static

Member Data Documentation

DtSimReport* DtReportMessage::myReport
protected
bool DtReportMessage::myOwnReport
protected

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)