Open Lighting Architecture  0.9.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
ola::client::BaseClientWrapper Class Reference

Detailed Description

The base Client Wrapper class.

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

Inheritance diagram for ola::client::BaseClientWrapper:
ola::client::GenericClientWrapper< ClientClass > ola::slp::SLPClientWrapper

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.
ola::io::SelectServerGetSelectServer ()
 Get the SelectServer used by this client.
bool Setup ()
 Setup the client.
bool Cleanup ()
 Reset the connection to the server.
void SocketClosed ()
 Called internally when the client socket is closed.

Protected Attributes

std::auto_ptr
< ola::network::TCPSocket
m_socket

Member Function Documentation

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

Reset the connection to the server.

Returns
true if the setup succeeded, false otherwise.
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.
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.
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: