VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
makVrf::DtDebugDrawConnector Class Reference

The DtDebugDrawConnector class manages the connection with the server and provides and interface to send and receive messages with the server.

Public Types

typedef DtDelegate< void,
DtDebugDrawConnector * > 
DtConnectionDelegate
 

Public Member Functions

 DtDebugDrawConnector ()
 
virtual ~DtDebugDrawConnector ()
 
virtual void connect (const std::string &address, int port=DtDisplayPort, const std::string &simAddress="", bool attemptRetry=true)
 
virtual void disconnect ()
 
virtual bool isOk ()
 
virtual void tick ()
 
virtual void sendMessage (DtBaseMessage &request)
 
virtual DtMessageHandlermessageHandler ()
 
virtual void addConnectedCallback (const DtConnectionDelegate &delegate)
 
virtual void removeConnectedCallback (const DtConnectionDelegate &delegate)
 
virtual void addDisconnectedCallback (const DtConnectionDelegate &delegate)
 
virtual void removeDisconnectedCallback (const DtConnectionDelegate &delegate)
 
virtual DtMessageFactorymessageFactory ()
 
virtual unsigned int nextId ()
 
virtual std::string & requesterName ()
 

Static Public Member Functions

static double defaultRetryTimeout ()
 
static void setDefaultRetryTimeout (double val)
 
static double defaultHeartbeatTimeout ()
 
static void setDefaultHeatbeatTimeout (double val)
 

Protected Member Functions

DtInetAddr findFirstNetworkDeviceAddress (bool &found) const
 

Static Protected Member Functions

static void workerFunction (void *data, volatile bool *stop)
 

Protected Attributes

DtMessageHandler myMessageHandler
 
std::list< DtConnectionDelegatemyConnectionCallbacks
 
std::list< DtConnectionDelegatemyDisconnectionCallbacks
 
DtMessageFactory myMessageFactory
 
unsigned int myNextId
 
std::string myRequestorName
 
DtLocklessQueue< DtBaseMessage * > myOutgoingQueue
 
DtLocklessQueue< DtBaseMessage * > myIncomingQueue
 
DtThread * myWorkerThread
 
DtInetTcpSocket * mySocket
 
bool myShouldRetryConnect
 
double myRetryTimeout
 
std::string myAddress
 
std::string mySimAddress
 
int myPort
 
bool myShouldQuit
 

Static Protected Attributes

static double theDefaultHeatbeatTimeout
 
static double theDefaultRetryTimeout
 

Member Typedef Documentation

Connection callback definition.

Constructor & Destructor Documentation

makVrf::DtDebugDrawConnector::DtDebugDrawConnector ( )

constructor/destructor

virtual makVrf::DtDebugDrawConnector::~DtDebugDrawConnector ( )
virtual

Member Function Documentation

virtual void makVrf::DtDebugDrawConnector::connect ( const std::string &  address,
int  port = DtDisplayPort,
const std::string &  simAddress = "",
bool  attemptRetry = true 
)
virtual

this establishes a connection to a remote RadarFX server at a given address and port the connection callback will be run when a connection is made. It will continue to retry if there is a failure to connect or the connector gets disconnected if attemptRetry is true

virtual void makVrf::DtDebugDrawConnector::disconnect ( )
virtual

Disconnects from a RadarFX server.

virtual bool makVrf::DtDebugDrawConnector::isOk ( )
virtual

Returns true of the connection has succeed and is valid.

virtual void makVrf::DtDebugDrawConnector::tick ( )
virtual

Tick must be called periodically to allow message callbacks to be run.

virtual void makVrf::DtDebugDrawConnector::sendMessage ( DtBaseMessage request)
virtual

Sends a message to the server Application. A copy of the message is made internally, so the message being sent can go out of scope immediately after sendMessage is called.

virtual DtMessageHandler& makVrf::DtDebugDrawConnector::messageHandler ( )
inlinevirtual

Get the message handler the connector is using to dispatch messages when they arrive users will register their delegates with the message handler to execute their code when a message is received.

virtual void makVrf::DtDebugDrawConnector::addConnectedCallback ( const DtConnectionDelegate delegate)
virtual

Adds a callback for when a connection to a server succeeds.

virtual void makVrf::DtDebugDrawConnector::removeConnectedCallback ( const DtConnectionDelegate delegate)
virtual

Removes connection callback.

virtual void makVrf::DtDebugDrawConnector::addDisconnectedCallback ( const DtConnectionDelegate delegate)
virtual

Adds a callback for when disconnected to a server.

virtual void makVrf::DtDebugDrawConnector::removeDisconnectedCallback ( const DtConnectionDelegate delegate)
virtual

Removes disconnection callback.

virtual DtMessageFactory& makVrf::DtDebugDrawConnector::messageFactory ( )
inlinevirtual

Gets the message factory for all messages. The user can add new message decoders to this factory.

virtual unsigned int makVrf::DtDebugDrawConnector::nextId ( )
virtual

You can use this to get the next id for a message if your callback system needs to keep track of responses if any message being sent leaves the id field as 0, this function will be used to generate an id.

virtual std::string& makVrf::DtDebugDrawConnector::requesterName ( )
virtual

this provides a unique name for the requester. It is generated from the IP address and PID of the running application if any message being sent leaves the requester field blank, this function will be used to generate a requester names

static double makVrf::DtDebugDrawConnector::defaultRetryTimeout ( )
static

The default timeout for retrying. The default value is 5.

static void makVrf::DtDebugDrawConnector::setDefaultRetryTimeout ( double  val)
static

Sets the default retry timout. Value is in seconds.

static double makVrf::DtDebugDrawConnector::defaultHeartbeatTimeout ( )
static

the default hearbeat timeout. The default is 2.5 seconds.

static void makVrf::DtDebugDrawConnector::setDefaultHeatbeatTimeout ( double  val)
static

sets the default heartbeat timeout. Value is in seconds.

DtInetAddr makVrf::DtDebugDrawConnector::findFirstNetworkDeviceAddress ( bool found) const
protected
static void makVrf::DtDebugDrawConnector::workerFunction ( void *  data,
volatile bool stop 
)
staticprotected

Member Data Documentation

DtMessageHandler makVrf::DtDebugDrawConnector::myMessageHandler
protected
std::list<DtConnectionDelegate> makVrf::DtDebugDrawConnector::myConnectionCallbacks
protected
std::list<DtConnectionDelegate> makVrf::DtDebugDrawConnector::myDisconnectionCallbacks
protected
DtMessageFactory makVrf::DtDebugDrawConnector::myMessageFactory
protected
unsigned int makVrf::DtDebugDrawConnector::myNextId
protected
std::string makVrf::DtDebugDrawConnector::myRequestorName
protected
DtLocklessQueue<DtBaseMessage*> makVrf::DtDebugDrawConnector::myOutgoingQueue
protected
DtLocklessQueue<DtBaseMessage*> makVrf::DtDebugDrawConnector::myIncomingQueue
protected
DtThread* makVrf::DtDebugDrawConnector::myWorkerThread
protected
DtInetTcpSocket* makVrf::DtDebugDrawConnector::mySocket
protected
bool makVrf::DtDebugDrawConnector::myShouldRetryConnect
protected
double makVrf::DtDebugDrawConnector::myRetryTimeout
protected
std::string makVrf::DtDebugDrawConnector::myAddress
protected
std::string makVrf::DtDebugDrawConnector::mySimAddress
protected
int makVrf::DtDebugDrawConnector::myPort
protected
bool makVrf::DtDebugDrawConnector::myShouldQuit
protected
double makVrf::DtDebugDrawConnector::theDefaultHeatbeatTimeout
staticprotected
double makVrf::DtDebugDrawConnector::theDefaultRetryTimeout
staticprotected

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

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)