Open Lighting Architecture  0.9.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
ola::ClientBroker Class Reference

Detailed Description

Handles async client operations.

Since some client operations such as RDM commands are asynchronous, we can run into problems if the client disconnects while the operation is in progress. This is because the completion callback will hold a pointer to a client which has been deleted.

The ClientBroker acts as an in-between by holding a list of active clients and proxying RDM calls. When the RDM call returns, if the client responsible for the call has been deleted, we delete the callback rather then executing it.

Public Member Functions

void AddClient (const Client *client)
 Add a client to the broker.
void RemoveClient (const Client *client)
 Remove a client from the broker.
void SendRDMRequest (const Client *client, Universe *universe, const ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
 Make an RDM call.

Member Function Documentation

void ola::ClientBroker::AddClient ( const Client client)

Add a client to the broker.

Parameters
clientthe Client to add. Ownership is not transferred.
void ola::ClientBroker::RemoveClient ( const Client client)

Remove a client from the broker.

Parameters
clientThe Client to remove.
void ola::ClientBroker::SendRDMRequest ( const Client client,
Universe universe,
const ola::rdm::RDMRequest request,
ola::rdm::RDMCallback callback 
)

Make an RDM call.

Parameters
clientthe Client responsible for making the call.
universethe universe to send the RDM request on.
requestthe RDM request.
callbackthe callback to run when the request completes. Ownership is transferred.

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