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

Detailed Description

The main OlaServer class.

Inheritance diagram for ola::OlaServer:
ola::rpc::RpcSessionHandlerInterface

Classes

struct  ClientEntry
struct  Options
 Options for the OlaServer. More...

Public Member Functions

 OlaServer (const std::vector< class PluginLoader * > &plugin_loaders, class PreferencesFactory *preferences_factory, ola::io::SelectServer *ss, const Options &ola_options, ola::network::TCPAcceptingSocket *socket=NULL, ExportMap *export_map=NULL)
 Create a new instance of the OlaServer.
 ~OlaServer ()
 Shutdown the server.
bool Init ()
 Initialize the OlaServer.
void ReloadPlugins ()
 Reload all plugins.
void ReloadPidStore ()
 Reload the pid store.
void StopServer ()
 Stop the OLA Server.
void NewConnection (ola::io::ConnectedDescriptor *descriptor)
 Add a new ConnectedDescriptor to this Server.
ola::network::GenericSocketAddress LocalRPCAddress () const
 Return the socket address the RPC server is listening on.
void NewClient (ola::rpc::RpcSession *session)
 Called by the RpcServer when a client connects.
void ClientRemoved (ola::rpc::RpcSession *session)
 Called by the RpcServer when a client disconnects.
const std::string InstanceName ()
 Get the instance name.

Static Public Attributes

static const unsigned int DEFAULT_HTTP_PORT = 9090
static const unsigned int DEFAULT_RPC_PORT = OLA_DEFAULT_PORT

Constructor & Destructor Documentation

ola::OlaServer::OlaServer ( const std::vector< class PluginLoader * > &  plugin_loaders,
class PreferencesFactory preferences_factory,
ola::io::SelectServer ss,
const Options ola_options,
ola::network::TCPAcceptingSocket socket = NULL,
ExportMap export_map = NULL 
)

Create a new instance of the OlaServer.

Parameters
plugin_loadersA list of PluginLoaders to use to find plugins.
preferences_factoryThe factory to use when creating Preference objects.
ssThe SelectServer.
ola_optionsThe OlaServer options.
socketAn optional TCPAcceptingSocket in the listen state to use for client RPC calls. Ownership is transferred.
export_mapAn optional ExportMap. If set to NULL a new ExportMap will be created.

Member Function Documentation

void ola::OlaServer::ClientRemoved ( ola::rpc::RpcSession session)
virtual

Called by the RpcServer when a client disconnects.

Parameters
sessionthe RpcSession for the client.

Implements ola::rpc::RpcSessionHandlerInterface.

bool ola::OlaServer::Init ( )

Initialize the OlaServer.

Returns
true if initialization succeeded, false if it failed.
const std::string ola::OlaServer::InstanceName ( )
inline

Get the instance name.

Returns
a string which is the instance name
ola::network::GenericSocketAddress ola::OlaServer::LocalRPCAddress ( ) const

Return the socket address the RPC server is listening on.

Returns
A socket address, which is empty if the server hasn't been initialized.
void ola::OlaServer::NewClient ( ola::rpc::RpcSession session)
virtual

Called by the RpcServer when a client connects.

Parameters
sessionthe RpcSession for the client.

Implements ola::rpc::RpcSessionHandlerInterface.

void ola::OlaServer::NewConnection ( ola::io::ConnectedDescriptor descriptor)

Add a new ConnectedDescriptor to this Server.

Parameters
descriptorthe new ConnectedDescriptor, ownership is transferred.
void ola::OlaServer::ReloadPidStore ( )

Reload the pid store.

This method is thread safe.

void ola::OlaServer::ReloadPlugins ( )

Reload all plugins.

This method is thread safe.

void ola::OlaServer::StopServer ( )
inline

Stop the OLA Server.

This terminates the underlying SelectServer.


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