![]() |
VR-Forces 5.0.2 Developer's Guide
|
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 DtMessageHandler & | messageHandler () |
| 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 DtMessageFactory & | messageFactory () |
| 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< DtConnectionDelegate > | myConnectionCallbacks |
| std::list< DtConnectionDelegate > | myDisconnectionCallbacks |
| 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 |
Connection callback definition.
| makVrf::DtDebugDrawConnector::DtDebugDrawConnector | ( | ) |
constructor/destructor
|
virtual |
|
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 |
Disconnects from a RadarFX server.
|
virtual |
Returns true of the connection has succeed and is valid.
|
virtual |
Tick must be called periodically to allow message callbacks to be run.
|
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.
|
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 |
Adds a callback for when a connection to a server succeeds.
|
virtual |
Removes connection callback.
|
virtual |
Adds a callback for when disconnected to a server.
|
virtual |
Removes disconnection callback.
|
inlinevirtual |
Gets the message factory for all messages. The user can add new message decoders to this factory.
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 |
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 |
The default timeout for retrying. The default value is 5.
|
static |
Sets the default retry timout. Value is in seconds.
|
static |
the default hearbeat timeout. The default is 2.5 seconds.
|
static |
sets the default heartbeat timeout. Value is in seconds.
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |