Open Lighting Architecture  Latest Git
Public Types | Public Member Functions | Protected Attributes | List of all members
ola::client::BaseClientWrapper Class Referenceabstract

Detailed Description

The base Client Wrapper class.

This encapsulates the calls required to setup a connection to olad.

Inheritance diagram for ola::client::BaseClientWrapper:
Inheritance graph
[legend]
Collaboration diagram for ola::client::BaseClientWrapper:
Collaboration graph
[legend]

Public Types

typedef Callback0< void > CloseCallback
 

Public Member Functions

void SetCloseCallback (CloseCallback *callback)
 Set the callback to be run when the client socket is closed. More...
 
ola::io::SelectServerGetSelectServer ()
 Get the SelectServer used by this client. More...
 
bool Setup ()
 Setup the client. More...
 
bool Cleanup ()
 Reset the connection to the server. More...
 
void SocketClosed ()
 Called internally when the client socket is closed.
 

Protected Attributes

std::auto_ptr< ola::network::TCPSocketm_socket
 

Member Function Documentation

◆ Cleanup()

bool ola::client::BaseClientWrapper::Cleanup ( )

Reset the connection to the server.

Returns
true if the reset succeeded, false otherwise.

◆ GetSelectServer()

ola::io::SelectServer* ola::client::BaseClientWrapper::GetSelectServer ( )
inline

Get the SelectServer used by this client.

Returns
A pointer to a SelectServer, ownership isn't transferred.

◆ SetCloseCallback()

void ola::client::BaseClientWrapper::SetCloseCallback ( CloseCallback callback)

Set the callback to be run when the client socket is closed.

The default action is to terminate the SelectServer. By setting a callback you can override this behavior.

Parameters
callbackthe Callback to run, ownership is transferred.

◆ Setup()

bool ola::client::BaseClientWrapper::Setup ( )

Setup the client.

Returns
true on success, false on failure.

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