VR-Forces 5.0.2 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 | Friends
makVrv::DtCigiNetworkIO Class Reference

This class performs all of the network I/O for CIGI messages. This includes setting up the CIGI session, managing sockets, and setting the signal processor so that messages can be processed by the IG and responses can be sent back to the host.

Public Member Functions

virtual ~DtCigiNetworkIO ()
 
virtual bool receiveCigiMessages ()
 
virtual bool sendCigiMessages (unsigned int frameNumber, unsigned int lastHostFrameNumber, int igMode, int databaseNumber)
 
virtual bool readyToSendCigiMessages () const
 
virtual void setSignalProcessor (DtCigiSignalProcessor &sigProcessor)
 
virtual void sendHatHotResponse (const DtHatHotResponder::DtHatHotResponseData *hatHotResponse)
 
virtual void sendLosBasicResponse (DtCigiLosBasicResponse *losResponse)
 
virtual void sendLosExtendedResponse (DtCigiLosExtendedResponse *losResponse)
 
virtual void sendPositionResponse (DtPositionResponder::DtPositionResponseData *posResponse)
 
virtual void sendCollisionSegmentResponse (DtCollisionResponder::DtCollisionSegmentResponseData *collReponse)
 
virtual void sendSensorResponse (DtSensorResponder::DtSensorResponseData *sensorResponse)
 
virtual void sendUserPacket (CigiBasePacket *packet)
 
bool cigiSessionExists () const
 
virtual void packLosBasicResponseV3 (const DtCigiLosBasicResponse &response, CigiLosRespV3_2 &respPacket)
 
virtual void packLosBasicResponseV4 (const DtCigiLosBasicResponse &response, CigiLosRespV4 &respPacket)
 
virtual void packLosExtendedResponseV3 (const DtCigiLosExtendedResponse &response, CigiLosXRespV3_2 &respPacket)
 
virtual void packLosExtendedResponseV4 (const DtCigiLosExtendedResponse &response, CigiLosXRespV4 &respPacket)
 
virtual void packPositionResponseV3 (const DtPositionResponder::DtPositionResponseData &response, CigiPositionRespV3 &respPacket)
 
virtual void packPositionResponseV4 (const DtPositionResponder::DtPositionResponseData &response, CigiPositionRespV4 &respPacket)
 
virtual void packCollisionSegmentResponseV3 (const DtCollisionResponder::DtCollisionSegmentResponseData &response, CigiCollDetSegRespV3 &respPacket)
 
virtual void packCollisionSegmentResponseV4 (const DtCollisionResponder::DtCollisionSegmentResponseData &response, CigiCollDetSegRespV4 &respPacket)
 
virtual void packHatHotResponseV3 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotRespV3_2 &respPacket)
 
virtual void packHatHotResponseV4 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotRespV4 &respPacket)
 
virtual void packHatHotExtendedResponseV3 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotXRespV3_2 &respPacket)
 
virtual void packHatHotExtendedResponseV4 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotXRespV4 &respPacket)
 
virtual void packSensorResponseV3 (const DtSensorResponder::DtSensorResponseData &response, CigiSensorRespV3 &respPacket)
 
virtual void packSensorResponseV4 (const DtSensorResponder::DtSensorResponseData &response, CigiSensorRespV4 &respPacket)
 
virtual void packSensorExtendedResponseV3 (const DtSensorResponder::DtSensorResponseData &response, CigiSensorXRespV3 &respPacket)
 
virtual void packSensorExtendedResponseV4 (const DtSensorResponder::DtSensorResponseData &response, CigiSensorXRespV4 &respPacket)
 
virtual bool registerUserPacket (CigiBasePacket *packet, unsigned int packetId, bool hostSend, bool igSend)
 
virtual CigiIGSession & session ()
 
virtual const CigiIGSession & session () const
 

Static Public Member Functions

static bool addSocketCb (DtInetSocket *sock, void *usr)
 
static bool removeSocketCb (DtInetSocket *sock, void *usr)
 

Protected Member Functions

 DtCigiNetworkIO (const DtCigiConnectionInitializer &initializer, DtCigiConnection &connection)
 
virtual void initializeUdpSocket (const DtInetEndpoint &endpoint, unsigned int listenPort, DtInetDevice *device)
 
virtual void initializeTcpSocket (const DtInetEndpoint &endpoint, DtInetDevice *device, int localPort)
 
virtual void addSocket (DtInetTcpSocket *sock)
 
virtual void removeSocket (DtInetTcpSocket *sock)
 
virtual DtInetAddr findFirstNetworkDeviceAddress (bool &found) const
 
CigiBaseIGCtrl * igControlPacket (Cigi_uint8 *Dta)
 
 DtCigiNetworkIO (const DtCigiNetworkIO &orig)
 
DtCigiNetworkIOoperator= (const DtCigiNetworkIO &orig)
 

Protected Attributes

DtCigiConnectionmyConnection
 
DtInetSocket * mySocket
 
CigiIGSession * myCigiIgSession
 
DtInetBufferChain myReceiveBufferChain
 
DtInetBuffer myReceiveBuffer
 
unsigned int myReceiveBufferSize
 
DtInetEndpoint myDestinationAddress
 
DtCigiSignalProcessormySignalProcessor
 
DtInetSocketMgr * mySocketMgr
 
bool myUseTcpClient
 
bool myUseTcpServer
 
bool myUseSynchronousMode
 
double myTimeSlice
 
makCigiExt::DtCigiDiGuyCtrlmyDiGuyCtrlPacket
 
std::vector< const
DtHatHotResponder::DtHatHotResponseData * > 
myHatHotBasicResponses
 
std::vector< const
DtHatHotResponder::DtHatHotResponseData * > 
myHatHotExtendedResponses
 
std::vector
< DtCigiLosBasicResponse * > 
myLosBasicResponses
 
std::vector
< DtCigiLosExtendedResponse * > 
myLosExtendedResponses
 
std::vector
< DtPositionResponder::DtPositionResponseData * > 
myPositionResponses
 
std::vector
< DtCollisionResponder::DtCollisionSegmentResponseData * > 
myCollisionSegmentResponses
 
std::vector
< DtSensorResponder::DtSensorResponseData * > 
mySensorResponses
 
std::vector
< DtSensorResponder::DtSensorResponseData * > 
mySensorExtendedResponses
 
std::vector< CigiBasePacket * > myUserPacketsToSend
 
makCigiExt::DtCigiDiGuyCtrlExtmyDiGuyCtrlExtPacket
 
makCigiExt::DtCigiDiGuyExecuteGesturemyDiGuyExecuteGesturePacket
 
makCigiExt::DtCigiDiGuyEndGesturemyDiGuyEndGesturePacket
 
makCigiExt::DtCigiDiGuyCtrlExtV4myDiGuyCtrlExtPacketV4
 
makCigiExt::DtCigiDiGuyExecuteGestureV4myDiGuyExecuteGesturePacketV4
 
makCigiExt::DtCigiDiGuyEndGestureV4myDiGuyEndGesturePacketV4
 

Friends

class DtCigiNetworkIOCreator
 

Constructor & Destructor Documentation

virtual makVrv::DtCigiNetworkIO::~DtCigiNetworkIO ( )
virtual

Destructor.

makVrv::DtCigiNetworkIO::DtCigiNetworkIO ( const DtCigiConnectionInitializer initializer,
DtCigiConnection connection 
)
protected

Constructor Creates the appropriate socket based on the connection type in the initializer and sets up the CIGI Session.

makVrv::DtCigiNetworkIO::DtCigiNetworkIO ( const DtCigiNetworkIO orig)
protected

Non-copyable.

Member Function Documentation

virtual bool makVrv::DtCigiNetworkIO::receiveCigiMessages ( )
virtual

Receives any CIGI messages from the network and processes them.

Returns
True if the connection still exists, false otherwise.
virtual bool makVrv::DtCigiNetworkIO::sendCigiMessages ( unsigned int  frameNumber,
unsigned int  lastHostFrameNumber,
int  igMode,
int  databaseNumber 
)
virtual

Sends CIGI messages to the host. Sends start-of-frame if in synchronous mode, and any HAT/HOT/LOS responses that are queued up. The parameters are only used when sending start-of-frame.

Parameters
frameNumberThe current IG frame.
lastHostFrameNumberThe host frame from the last IG Control received.
igModeThe mode of the IG (see the CIGI ICD for values)
databaseNumberThe database number currently loaded/loading.
Returns
True if the connection still exists, false otherwise.
virtual bool makVrv::DtCigiNetworkIO::readyToSendCigiMessages ( ) const
virtual

Check if there are any CIGI messages to send.

Return values
trueif SOF or HAT/HOT/LOS responses are waiting to be sent.
falseotherwise.
virtual void makVrv::DtCigiNetworkIO::setSignalProcessor ( DtCigiSignalProcessor sigProcessor)
virtual

Set the object that will receive CIGI signals and emit signals for CIGI message processing.

virtual void makVrv::DtCigiNetworkIO::sendHatHotResponse ( const DtHatHotResponder::DtHatHotResponseData hatHotResponse)
virtual

Queues up a HAT/HOT response for sending when sendCigiMessages is called.

virtual void makVrv::DtCigiNetworkIO::sendLosBasicResponse ( DtCigiLosBasicResponse losResponse)
virtual

Queues up a LOS response for sending when sendCigiMessges is called.

virtual void makVrv::DtCigiNetworkIO::sendLosExtendedResponse ( DtCigiLosExtendedResponse losResponse)
virtual

Queues up a LOS response for sending when sendCigiMessges is called.

virtual void makVrv::DtCigiNetworkIO::sendPositionResponse ( DtPositionResponder::DtPositionResponseData posResponse)
virtual

Queues up position response.

virtual void makVrv::DtCigiNetworkIO::sendCollisionSegmentResponse ( DtCollisionResponder::DtCollisionSegmentResponseData collReponse)
virtual

Queues Collision Segment Reponse.

virtual void makVrv::DtCigiNetworkIO::sendSensorResponse ( DtSensorResponder::DtSensorResponseData sensorResponse)
virtual

Queues Sensor Response.

virtual void makVrv::DtCigiNetworkIO::sendUserPacket ( CigiBasePacket *  packet)
virtual

Specify a packet that will be included in the next CIGI message buffer. This is passed to the NetworkIO by the connections call of the same name.

virtual CigiIGSession& makVrv::DtCigiNetworkIO::session ( )
virtual

Access the cigi session. These will throw DtException if the session does not exist.

virtual const CigiIGSession& makVrv::DtCigiNetworkIO::session ( ) const
virtual

Access the cigi session. These will throw DtException if the session does not exist.

bool makVrv::DtCigiNetworkIO::cigiSessionExists ( ) const

Query if there is a (connected) cigi session.

virtual void makVrv::DtCigiNetworkIO::packLosBasicResponseV3 ( const DtCigiLosBasicResponse response,
CigiLosRespV3_2 &  respPacket 
)
virtual

Fill in a CigiLosRespV3_2 packet from a DtCigiLosBasicResponse.

virtual void makVrv::DtCigiNetworkIO::packLosBasicResponseV4 ( const DtCigiLosBasicResponse response,
CigiLosRespV4 &  respPacket 
)
virtual

Fill in a CigiLosRespV4 packet from a DtCigiLosBasicResponse.

virtual void makVrv::DtCigiNetworkIO::packLosExtendedResponseV3 ( const DtCigiLosExtendedResponse response,
CigiLosXRespV3_2 &  respPacket 
)
virtual

Fill in a CigiLosXRespV3_2 packet from a DtCigiLosExtendedResponse.

virtual void makVrv::DtCigiNetworkIO::packLosExtendedResponseV4 ( const DtCigiLosExtendedResponse response,
CigiLosXRespV4 &  respPacket 
)
virtual

Fill in a CigiLosXRespV4 packet from a DtCigiLosExtendedResponse.

virtual void makVrv::DtCigiNetworkIO::packPositionResponseV3 ( const DtPositionResponder::DtPositionResponseData response,
CigiPositionRespV3 &  respPacket 
)
virtual

Fill in Cigi Position Resp.

virtual void makVrv::DtCigiNetworkIO::packPositionResponseV4 ( const DtPositionResponder::DtPositionResponseData response,
CigiPositionRespV4 &  respPacket 
)
virtual
virtual void makVrv::DtCigiNetworkIO::packCollisionSegmentResponseV3 ( const DtCollisionResponder::DtCollisionSegmentResponseData response,
CigiCollDetSegRespV3 &  respPacket 
)
virtual

Fill in Cigi Collision Segment Response.

virtual void makVrv::DtCigiNetworkIO::packCollisionSegmentResponseV4 ( const DtCollisionResponder::DtCollisionSegmentResponseData response,
CigiCollDetSegRespV4 &  respPacket 
)
virtual
virtual void makVrv::DtCigiNetworkIO::packHatHotResponseV3 ( const DtHatHotResponder::DtHatHotResponseData response,
CigiHatHotRespV3_2 &  respPacket 
)
virtual

Fill in Cigi HATHOT Response Packet.

virtual void makVrv::DtCigiNetworkIO::packHatHotResponseV4 ( const DtHatHotResponder::DtHatHotResponseData response,
CigiHatHotRespV4 &  respPacket 
)
virtual
virtual void makVrv::DtCigiNetworkIO::packHatHotExtendedResponseV3 ( const DtHatHotResponder::DtHatHotResponseData response,
CigiHatHotXRespV3_2 &  respPacket 
)
virtual

Fill in Cigi HATHOT Extended Response Packet.

virtual void makVrv::DtCigiNetworkIO::packHatHotExtendedResponseV4 ( const DtHatHotResponder::DtHatHotResponseData response,
CigiHatHotXRespV4 &  respPacket 
)
virtual
virtual void makVrv::DtCigiNetworkIO::packSensorResponseV3 ( const DtSensorResponder::DtSensorResponseData response,
CigiSensorRespV3 &  respPacket 
)
virtual

Fill in Cigi Sensor Response.

virtual void makVrv::DtCigiNetworkIO::packSensorResponseV4 ( const DtSensorResponder::DtSensorResponseData response,
CigiSensorRespV4 &  respPacket 
)
virtual
virtual void makVrv::DtCigiNetworkIO::packSensorExtendedResponseV3 ( const DtSensorResponder::DtSensorResponseData response,
CigiSensorXRespV3 &  respPacket 
)
virtual

Fill in Cigi Sensor Extended Response.

virtual void makVrv::DtCigiNetworkIO::packSensorExtendedResponseV4 ( const DtSensorResponder::DtSensorResponseData response,
CigiSensorXRespV4 &  respPacket 
)
virtual
virtual bool makVrv::DtCigiNetworkIO::registerUserPacket ( CigiBasePacket *  packet,
unsigned int  packetId,
bool  hostSend,
bool  igSend 
)
virtual

Register a user defined packet manager.

static bool makVrv::DtCigiNetworkIO::addSocketCb ( DtInetSocket *  sock,
void *  usr 
)
static

Callback when a TCP connection is added. Used only in TCP server mode.

static bool makVrv::DtCigiNetworkIO::removeSocketCb ( DtInetSocket *  sock,
void *  usr 
)
static

Callback when a TCP connection is removed. Used only in TCP server mode.

virtual void makVrv::DtCigiNetworkIO::initializeUdpSocket ( const DtInetEndpoint &  endpoint,
unsigned int  listenPort,
DtInetDevice *  device 
)
protectedvirtual

Initialize a UDP socket.

virtual void makVrv::DtCigiNetworkIO::initializeTcpSocket ( const DtInetEndpoint &  endpoint,
DtInetDevice *  device,
int  localPort 
)
protectedvirtual

Initialize a TCP client socket.

virtual void makVrv::DtCigiNetworkIO::addSocket ( DtInetTcpSocket *  sock)
protectedvirtual

Called from addSocketCb.

virtual void makVrv::DtCigiNetworkIO::removeSocket ( DtInetTcpSocket *  sock)
protectedvirtual

Called from removeSocketCb.

virtual DtInetAddr makVrv::DtCigiNetworkIO::findFirstNetworkDeviceAddress ( bool found) const
protectedvirtual
CigiBaseIGCtrl* makVrv::DtCigiNetworkIO::igControlPacket ( Cigi_uint8 *  Dta)
protected

Get a pointer to the igControl packet as the front of an incoming CIGI Message. This is a peek, and does not modify the buffer.

DtCigiNetworkIO& makVrv::DtCigiNetworkIO::operator= ( const DtCigiNetworkIO orig)
protected

Non-copyable.

Friends And Related Function Documentation

friend class DtCigiNetworkIOCreator
friend

Member Data Documentation

DtCigiConnection& makVrv::DtCigiNetworkIO::myConnection
protected
DtInetSocket* makVrv::DtCigiNetworkIO::mySocket
protected

The socket. May be a UDP or TCP socket.

CigiIGSession* makVrv::DtCigiNetworkIO::myCigiIgSession
protected

The CIGI Session.

DtInetBufferChain makVrv::DtCigiNetworkIO::myReceiveBufferChain
protected

The buffer chains used to receive CIGI messages.

DtInetBuffer makVrv::DtCigiNetworkIO::myReceiveBuffer
protected

The buffer used to receive CIGI messages.

unsigned int makVrv::DtCigiNetworkIO::myReceiveBufferSize
protected

The size of the buffer used to receive CIGI messages.

DtInetEndpoint makVrv::DtCigiNetworkIO::myDestinationAddress
protected

The address/port of the host.

DtCigiSignalProcessor* makVrv::DtCigiNetworkIO::mySignalProcessor
protected
DtInetSocketMgr* makVrv::DtCigiNetworkIO::mySocketMgr
protected

The socket manager holds the TCP server socket and manages connections in TCP server mode.

bool makVrv::DtCigiNetworkIO::myUseTcpClient
protected

Whether using TCP client mode. If this and myUseTcpServer are false, UDP is being used.

bool makVrv::DtCigiNetworkIO::myUseTcpServer
protected

Whether we're using TCP server mode. If this and myUseTcpClient are false, UDP is being used.

bool makVrv::DtCigiNetworkIO::myUseSynchronousMode
protected

Whether we're using synchronous mode or not. Start of frame CIGI messages will only be sent in synchronous mode.

std::vector<const DtHatHotResponder::DtHatHotResponseData*> makVrv::DtCigiNetworkIO::myHatHotBasicResponses
protected

Queues to send to the host. If a new type of queue is added, make sure it is added to readyToSendCigiMessages for async sessions.The HAT/HOT Response queue.

std::vector<const DtHatHotResponder::DtHatHotResponseData*> makVrv::DtCigiNetworkIO::myHatHotExtendedResponses
protected

Queues to send to the host. If a new type of queue is added, make sure it is added to readyToSendCigiMessages for async sessions.The HAT/HOT Response queue.

std::vector<DtCigiLosBasicResponse*> makVrv::DtCigiNetworkIO::myLosBasicResponses
protected

The LOS Response queues.

std::vector<DtCigiLosExtendedResponse*> makVrv::DtCigiNetworkIO::myLosExtendedResponses
protected

Queues to send to the host. If a new type of queue is added, make sure it is added to readyToSendCigiMessages for async sessions.The HAT/HOT Response queue.

std::vector<DtPositionResponder::DtPositionResponseData*> makVrv::DtCigiNetworkIO::myPositionResponses
protected

The Position Response queue.

std::vector<DtCollisionResponder::DtCollisionSegmentResponseData*> makVrv::DtCigiNetworkIO::myCollisionSegmentResponses
protected

The Collision Response queue.

std::vector<DtSensorResponder::DtSensorResponseData*> makVrv::DtCigiNetworkIO::mySensorResponses
protected

The Sensor Response queue.

std::vector<DtSensorResponder::DtSensorResponseData*> makVrv::DtCigiNetworkIO::mySensorExtendedResponses
protected

Queues to send to the host. If a new type of queue is added, make sure it is added to readyToSendCigiMessages for async sessions.The HAT/HOT Response queue.

std::vector<CigiBasePacket*> makVrv::DtCigiNetworkIO::myUserPacketsToSend
protected

Queues to send to the host. If a new type of queue is added, make sure it is added to readyToSendCigiMessages for async sessions.The HAT/HOT Response queue.

double makVrv::DtCigiNetworkIO::myTimeSlice
protected

Time alloted to check for packet buffers on the socket.

makCigiExt::DtCigiDiGuyCtrl* makVrv::DtCigiNetworkIO::myDiGuyCtrlPacket
protected

Deprecated - This points to the sample DtCigiDiGuyCtrl we create and that CIGI uses to decode these packets.

makCigiExt::DtCigiDiGuyCtrlExt* makVrv::DtCigiNetworkIO::myDiGuyCtrlExtPacket
protected

CIGI V3 Extension Packets.

This points to the sample DtCigiDiGuyCtrlExt we create and that CIGI uses to decode these packets. This is the newer, extended version of the packet that includes scale, weight, item and head appearances

makCigiExt::DtCigiDiGuyExecuteGesture* makVrv::DtCigiNetworkIO::myDiGuyExecuteGesturePacket
protected

This points to the sample DtCigiDiGuyExecuteGesture we create and that CIGI uses to decode these packets. This is used to start the execution of a gesture.

makCigiExt::DtCigiDiGuyEndGesture* makVrv::DtCigiNetworkIO::myDiGuyEndGesturePacket
protected

This points to the sample DtCigiDiGuyEndGesture we create and that CIGI uses to decode these packets. This is used to end the execution of a gesture.

makCigiExt::DtCigiDiGuyCtrlExtV4* makVrv::DtCigiNetworkIO::myDiGuyCtrlExtPacketV4
protected

CIGI V4 Extension Packets.

This points to the sample DtCigiDiGuyCtrlExtV4 we create and that CIGI uses to decode these packets. This is the newer, extended version of the packet that includes scale, weight, item and head appearances

makCigiExt::DtCigiDiGuyExecuteGestureV4* makVrv::DtCigiNetworkIO::myDiGuyExecuteGesturePacketV4
protected

This points to the sample DtCigiDiGuyExecuteGestureV4 we create and that CIGI uses to decode these packets. This is used to start the execution of a gesture.

makCigiExt::DtCigiDiGuyEndGestureV4* makVrv::DtCigiNetworkIO::myDiGuyEndGesturePacketV4
protected

This points to the sample DtCigiDiGuyEndGestureV4 we create and that CIGI uses to decode these packets. This is used to end the execution of a gesture.


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

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)