![]() |
RadarFX API Documentation
|
The DtRadarFXConnector class manages the connection with the server and provides and interface to send and receive messages with the server. More...
Public Types | |
| typedef DtDelegate< void, DtRadarFxConnector * > | DtConnectionDelegate |
| Connection callback definition. | |
Public Member Functions | |
| DtRadarFxConnector () | |
| constructor/destructor | |
| virtual | ~DtRadarFxConnector () |
| virtual void | connect (const std::string &address, int port=DtRadarFXPort, bool attemptRetry=true) |
| 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. | |
| virtual void | disconnect () |
| Disconnects from a RadarFX server. | |
| virtual bool | isOk () |
| Returns true of the connection has succeed and is valid. | |
| virtual void | tick () |
| Tick must be called periodically to allow message callbacks to be run. | |
| virtual void | sendMessage (DtBaseMessage &request) |
| Sends a message to the Radar FX server. | |
| virtual DtMessageHandler & | messageHandler () |
| 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 | addConnectedCallback (const DtConnectionDelegate &delegate) |
| Adds a callback for when a connection to a server succeeds. | |
| virtual void | removeConnectedCallback (const DtConnectionDelegate &delegate) |
| Removes connection callback. | |
| virtual void | addDisconnectedCallback (const DtConnectionDelegate &delegate) |
| Adds a callback for when disconnected to a server. | |
| virtual void | removeDisconnectedCallback (const DtConnectionDelegate &delegate) |
| Removes disconnection callback. | |
| virtual DtMessageFactory & | messageFactory () |
| Gets the message factory for all messages. | |
| virtual unsigned int | nextId () |
| 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 & | requesterName () |
| this provides a unique name for the requester. | |
Static Public Member Functions | |
| static double | defaultRetryTimeout () |
| The default timeout for retrying. The default value is 5. | |
| static void | setDefaultRetryTimeout (double val) |
| Sets the default retry timout. Value is in seconds. | |
| static double | defaultHeartbeatTimeout () |
| the default hearbeat timeout. The default is 2.5 seconds. | |
| static void | setDefaultHeatbeatTimeout (double val) |
| sets the default heartbeat timeout. Value is in seconds. | |
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 |
| int | myPort |
| bool | myShouldQuit |
Static Protected Attributes | |
| static double | theDefaultHeatbeatTimeout |
| static double | theDefaultRetryTimeout |
The DtRadarFXConnector class manages the connection with the server and provides and interface to send and receive messages with the server.
Connection callback definition.
| makRadarFx::DtRadarFxConnector::DtRadarFxConnector | ( | ) |
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 Radar FX server.
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
|
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 |
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 |