VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::TacCommandMessage Class Reference

#include <tacCommand.h>

Inheritance diagram for makVre::TacCommandMessage:
[legend]

Classes

struct  TacCommandData
 

Public Types

enum  Command {
  Command_X , Command_Y , Command_SELECT , Command_CYCLE_FORWARD ,
  Command_CYCLE_BACK , Command_CLEAR
}
 

Public Member Functions

virtual const std::string & type () const override
 
virtual const makVre::DtVreMessageIdmessageId () const override
 
virtual ~TacCommandMessage () override
 
virtual Command getCommand () const
 
virtual void setCommand (Command val)
 
virtual double getValue () const
 
virtual void setValue (double val)
 
virtual int messageSize () const override
 
TacCommandData getData ()
 
TacCommandData getData () const
 
bool operator== (const TacCommandMessage &rhs) const
 
- Public Member Functions inherited from makVre::DtVreMessage
 DtVreMessage ()
 
virtual ~DtVreMessage ()
 
virtual char * encode ()
 
virtual void encode (char *buffer, int bufferSize)
 
virtual const UInt64 originatingApplicationId () const
 
virtual void setOriginatingApplicationId (UInt64 appId)
 
virtual void setDelay (double delay)
 
virtual bool isDelayed ()
 
virtual void reduceDelay (double dt)
 
virtual const UInt64 versionNumber () const
 

Static Public Member Functions

static TacCommandMessagecreate ()
 
static TacCommandMessagecreateFrom (TacCommandMessage *)
 
static TacCommandMessagecreateFromData (const TacCommandData)
 
static const std::string & theType ()
 
static const makVre::DtVreMessageIdtheId ()
 
static UInt64 theVersionNumber ()
 
static makVre::DtVreMessagedecode (char *buffer, int length)
 

Protected Member Functions

 TacCommandMessage ()
 
virtual void serialize (DtStreamWriter &writer) const override
 
virtual void deserialize (DtStreamReader &reader) override
 

Protected Attributes

TacCommandData myData
 
- Protected Attributes inherited from makVre::DtVreMessage
double myDelay
 
UInt64 myApplicationId
 
UInt64 myVersion
 

Static Protected Attributes

static makVre::DtVreMessageId theMessageId
 
static UInt64 theVersion
 

Member Enumeration Documentation

◆ Command

Enumerator
Command_X 
Command_Y 
Command_SELECT 
Command_CYCLE_FORWARD 
Command_CYCLE_BACK 
Command_CLEAR 

Constructor & Destructor Documentation

◆ ~TacCommandMessage()

virtual makVre::TacCommandMessage::~TacCommandMessage ( )
overridevirtual

◆ TacCommandMessage()

makVre::TacCommandMessage::TacCommandMessage ( )
protected

Member Function Documentation

◆ create()

static TacCommandMessage * makVre::TacCommandMessage::create ( )
static

References TacCommandMessage().

◆ createFrom()

static TacCommandMessage * makVre::TacCommandMessage::createFrom ( TacCommandMessage * )
static

References TacCommandMessage().

◆ createFromData()

static TacCommandMessage * makVre::TacCommandMessage::createFromData ( const TacCommandData )
static

References TacCommandMessage().

◆ theType()

static const std::string & makVre::TacCommandMessage::theType ( )
static

static message identity functions

◆ theId()

static const makVre::DtVreMessageId & makVre::TacCommandMessage::theId ( )
static

◆ theVersionNumber()

static UInt64 makVre::TacCommandMessage::theVersionNumber ( )
static

◆ type()

virtual const std::string & makVre::TacCommandMessage::type ( ) const
overridevirtual

Get the name of the message type.

Implements makVre::DtVreMessage.

◆ messageId()

virtual const makVre::DtVreMessageId & makVre::TacCommandMessage::messageId ( ) const
overridevirtual

Gets the message ID object.

Returns
Reference to the message ID object

This pure virtual method must be implemented by derived classes to return a unique identifier object for the message. The message ID contains both the type name and a hash value for efficient routing.

Implements makVre::DtVreMessage.

◆ getCommand()

virtual Command makVre::TacCommandMessage::getCommand ( ) const
virtual

◆ setCommand()

virtual void makVre::TacCommandMessage::setCommand ( Command val)
virtual

◆ getValue()

virtual double makVre::TacCommandMessage::getValue ( ) const
virtual

◆ setValue()

virtual void makVre::TacCommandMessage::setValue ( double val)
virtual

◆ messageSize()

virtual int makVre::TacCommandMessage::messageSize ( ) const
overridevirtual

Static decode function pattern for derived classes.

Note
Each derived class must implement a static decode function with the signature:
static DtVreMessage* decode(unsigned char* buffer, int length);
DtVreMessage()
Default constructor.
static makVre::DtVreMessage * decode(char *buffer, int length)
This function is used by the message factory to create messages from raw data.

Gets the total size of the serialized message in bytes

Returns
Size of the message in bytes

This method calculates the total size of the message when serialized, including the base message header (message size, type hash, application ID, version, and delay) and any data added by derived classes.

Derived classes should override this method to include their own data size while calling the base class implementation.

Reimplemented from makVre::DtVreMessage.

◆ decode()

static makVre::DtVreMessage * makVre::TacCommandMessage::decode ( char * buffer,
int length )
static

◆ getData() [1/2]

TacCommandData makVre::TacCommandMessage::getData ( )

◆ getData() [2/2]

TacCommandData makVre::TacCommandMessage::getData ( ) const

◆ operator==()

bool makVre::TacCommandMessage::operator== ( const TacCommandMessage & rhs) const

References TacCommandMessage().

◆ serialize()

virtual void makVre::TacCommandMessage::serialize ( DtStreamWriter & writer) const
overrideprotectedvirtual

Serializes the message to a stream writer.

Parameters
writerReference to the stream writer

This method writes the message header fields to the stream writer. Derived classes should override this method to add their own fields while calling the base class implementation.

Reimplemented from makVre::DtVreMessage.

◆ deserialize()

virtual void makVre::TacCommandMessage::deserialize ( DtStreamReader & reader)
overrideprotectedvirtual

Deserializes the message from a stream reader.

Parameters
readerReference to the stream reader

This method reads the message header fields from the stream reader. Derived classes should override this method to read their own fields while calling the base class implementation.

Reimplemented from makVre::DtVreMessage.

Member Data Documentation

◆ theMessageId

makVre::DtVreMessageId makVre::TacCommandMessage::theMessageId
staticprotected

◆ theVersion

UInt64 makVre::TacCommandMessage::theVersion
staticprotected

◆ myData

TacCommandData makVre::TacCommandMessage::myData
protected

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