VR-Forces 4.8 Class Documentation
 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. More...

Public Member Functions

virtual ~DtCigiNetworkIO ()
 Destructor. More...
 
virtual bool receiveCigiMessages ()
 Receives any CIGI messages from the network and processes them. More...
 
virtual bool sendCigiMessages (unsigned int frameNumber, unsigned int lastHostFrameNumber, int igMode, int databaseNumber)
 Sends CIGI messages to the host. More...
 
virtual void getCigiVersionFromPacket ()
 Check the first incoming packet for a CigiVersion. More...
 
virtual bool readyToSendCigiMessages () const
 Check if there are any CIGI messages to send. More...
 
virtual void setSignalProcessor (DtCigiSignalProcessor &sigProcessor)
 Set the object that will receive CIGI signals and emit signals for CIGI message processing. More...
 
virtual void sendHatHotResponse (const DtHatHotResponder::DtHatHotResponseData *hatHotResponse)
 Queues up a HAT/HOT response for sending when sendCigiMessages is called. More...
 
virtual void sendLosBasicResponse (DtCigiLosBasicResponse *losResponse)
 Queues up a LOS response for sending when sendCigiMessges is called. More...
 
virtual void sendLosExtendedResponse (DtCigiLosExtendedResponse *losResponse)
 Queues up a LOS response for sending when sendCigiMessges is called. More...
 
virtual void sendPositionResponse (DtPositionResponder::DtPositionResponseData *posResponse)
 Queues up position response. More...
 
virtual void sendCollisionSegmentResponse (DtCollisionResponder::DtCollisionSegmentResponseData *collReponse)
 Queues Collision Segment Reponse. More...
 
virtual void sendUserPacket (CigiBasePacket *packet)
 Specify a packet that will be included in the next CIGI message buffer. More...
 
bool cigiSessionExists () const
 Query if there is a (connected) cigi session. More...
 
virtual void packLosBasicResponseV3 (const DtCigiLosBasicResponse &response, CigiLosRespV3_2 &respPacket)
 Fill in a CigiLosRespV3_2 packet from a DtCigiLosBasicResponse. More...
 
virtual void packLosBasicResponseV4 (const DtCigiLosBasicResponse &response, CigiLosRespV4 &respPacket)
 Fill in a CigiLosRespV4 packet from a DtCigiLosBasicResponse. More...
 
virtual void packLosExtendedResponseV3 (const DtCigiLosExtendedResponse &response, CigiLosXRespV3_2 &respPacket)
 Fill in a CigiLosXRespV3_2 packet from a DtCigiLosExtendedResponse. More...
 
virtual void packLosExtendedResponseV4 (const DtCigiLosExtendedResponse &response, CigiLosXRespV4 &respPacket)
 Fill in a CigiLosXRespV4 packet from a DtCigiLosExtendedResponse. More...
 
virtual void packPositionResponseV3 (const DtPositionResponder::DtPositionResponseData &response, CigiPositionRespV3 &respPacket)
 Fill in Cigi Position Resp. More...
 
virtual void packPositionResponseV4 (const DtPositionResponder::DtPositionResponseData &response, CigiPositionRespV4 &respPacket)
 
virtual void packCollisionSegmentResponseV3 (const DtCollisionResponder::DtCollisionSegmentResponseData &response, CigiCollDetSegRespV3 &respPacket)
 Fill in Cigi Collision Segment Response. More...
 
virtual void packCollisionSegmentResponseV4 (const DtCollisionResponder::DtCollisionSegmentResponseData &response, CigiCollDetSegRespV4 &respPacket)
 
virtual void packHatHotResponseV3 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotRespV3_2 &respPacket)
 Fill in Cigi HATHOT Response Packet. More...
 
virtual void packHatHotResponseV4 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotRespV4 &respPacket)
 
virtual void packHatHotExtendedResponseV3 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotXRespV3_2 &respPacket)
 Fill in Cigi HATHOT Extended Response Packet. More...
 
virtual void packHatHotExtendedResponseV4 (const DtHatHotResponder::DtHatHotResponseData &response, CigiHatHotXRespV4 &respPacket)
 
virtual bool registerUserPacket (CigiBasePacket *packet, unsigned int packetId, bool hostSend, bool igSend)
 Register a user defined packet manager. More...
 
virtual CigiIGSession & session ()
 Access the cigi session. More...
 
virtual const CigiIGSession & session () const
 

Static Public Member Functions

static bool addSocketCb (DtInetSocket *sock, void *usr)
 Callback when a TCP connection is added. Used only in TCP server mode. More...
 
static bool removeSocketCb (DtInetSocket *sock, void *usr)
 Callback when a TCP connection is removed. Used only in TCP server mode. More...
 

Protected Member Functions

 DtCigiNetworkIO (const DtCigiConnectionInitializer &initializer, DtCigiConnection &connection)
 Constructor Creates the appropriate socket based on the connection type in the initializer and sets up the CIGI Session. More...
 
virtual void initializeUdpSocket (const DtInetEndpoint &endpoint, unsigned int listenPort, DtInetDevice *device)
 Initialize a UDP socket. More...
 
virtual void initializeTcpSocket (const DtInetEndpoint &endpoint, DtInetDevice *device, int localPort)
 Initialize a TCP client socket. More...
 
virtual void addSocket (DtInetTcpSocket *sock)
 Called from addSocketCb. More...
 
virtual void removeSocket (DtInetTcpSocket *sock)
 Called from removeSocketCb. More...
 
virtual DtInetAddr findFirstNetworkDeviceAddress (bool &found) const
 
CigiBaseIGCtrl * igControlPacket (Cigi_uint8 *Dta)
 Get a pointer to the igControl packet as the front of an incoming CIGI Message. More...
 
 DtCigiNetworkIO (const DtCigiNetworkIO &orig)
 Non-copyable. More...
 
DtCigiNetworkIOoperator= (const DtCigiNetworkIO &orig)
 Non-copyable. More...
 

Protected Attributes

DtCigiConnectionmyConnection
 
DtInetSocket * mySocket
 The socket. May be a UDP or TCP socket. More...
 
CigiIGSession * myCigiIgSession
 The CIGI Session. More...
 
DtInetBufferChain myReceiveBufferChain
 The buffer chains used to receive CIGI messages. More...
 
DtInetBuffer myReceiveBuffer
 The buffer used to receive CIGI messages. More...
 
unsigned int myReceiveBufferSize
 The size of the buffer used to receive CIGI messages. More...
 
DtInetEndpoint myDestinationAddress
 The address/port of the host. More...
 
DtCigiSignalProcessormySignalProcessor
 
DtInetSocketMgr * mySocketMgr
 The socket manager holds the TCP server socket and manages connections in TCP server mode. More...
 
bool myUseTcpClient
 Whether using TCP client mode. More...
 
bool myUseTcpServer
 Whether we're using TCP server mode. More...
 
bool myUseSynchronousMode
 Whether we're using synchronous mode or not. More...
 
CigiVersionID myCigiVersion
 CigiVersion read and set from first packet. More...
 
bool myCigiVersionSet
 Whether we have already set the CigiVersion for this session. More...
 
std::vector< const
DtHatHotResponder::DtHatHotResponseData * > 
myHatHotBasicResponses
 The HAT/HOT Response queue. More...
 
std::vector< const
DtHatHotResponder::DtHatHotResponseData * > 
myHatHotExtendedResponses
 
std::vector
< DtCigiLosBasicResponse * > 
myLosBasicResponses
 The LOS Response queues. More...
 
std::vector
< DtCigiLosExtendedResponse * > 
myLosExtendedResponses
 
std::vector
< DtPositionResponder::DtPositionResponseData * > 
myPositionResponses
 The Position Response queue. More...
 
std::vector
< DtCollisionResponder::DtCollisionSegmentResponseData * > 
myCollisionSegmentResponses
 The Collision Response queue. More...
 
std::vector< CigiBasePacket * > myUserPacketsToSend
 
double myTimeSlice
 Time alloted to check for packet buffers on the socket. More...
 
makCigiExt::DtCigiDiGuyCtrlmyDiGuyCtrlPacket
 Deprecated - This points to the sample DtCigiDiGuyCtrl we create and that CIGI uses to decode these packets. More...
 
makCigiExt::DtCigiDiGuyCtrlExtmyDiGuyCtrlExtPacket
 CIGI V3 Extension Packets. More...
 
makCigiExt::DtCigiDiGuyExecuteGesturemyDiGuyExecuteGesturePacket
 This points to the sample DtCigiDiGuyExecuteGesture we create and that CIGI uses to decode these packets. More...
 
makCigiExt::DtCigiDiGuyEndGesturemyDiGuyEndGesturePacket
 This points to the sample DtCigiDiGuyEndGesture we create and that CIGI uses to decode these packets. More...
 
makCigiExt::DtCigiDiGuyCtrlExtV4myDiGuyCtrlExtPacketV4
 CIGI V4 Extension Packets. More...
 
makCigiExt::DtCigiDiGuyExecuteGestureV4myDiGuyExecuteGesturePacketV4
 This points to the sample DtCigiDiGuyExecuteGestureV4 we create and that CIGI uses to decode these packets. More...
 
makCigiExt::DtCigiDiGuyEndGestureV4myDiGuyEndGesturePacketV4
 This points to the sample DtCigiDiGuyEndGestureV4 we create and that CIGI uses to decode these packets. More...
 

Friends

class DtCigiNetworkIOCreator
 

Detailed Description

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.

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 void makVrv::DtCigiNetworkIO::getCigiVersionFromPacket ( )
virtual

Check the first incoming packet for a CigiVersion.

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

CigiVersionID makVrv::DtCigiNetworkIO::myCigiVersion
protected

CigiVersion read and set from first packet.

bool makVrv::DtCigiNetworkIO::myCigiVersionSet
protected

Whether we have already set the CigiVersion for this session.

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

The HAT/HOT Response queue.

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

The LOS Response queues.

std::vector<DtCigiLosExtendedResponse*> makVrv::DtCigiNetworkIO::myLosExtendedResponses
protected
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<CigiBasePacket*> makVrv::DtCigiNetworkIO::myUserPacketsToSend
protected
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 Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)