Open Lighting Architecture  0.10.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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:
Inheritance graph
[legend]
Collaboration diagram for ola::OlaServer:
Collaboration graph
[legend]

Classes

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. More...
 
 ~OlaServer ()
 Shutdown the server.
 
bool Init ()
 Initialize the OlaServer. More...
 
void ReloadPlugins ()
 Reload all plugins. More...
 
void ReloadPidStore ()
 Reload the pid store. More...
 
void StopServer ()
 Stop the OLA Server. More...
 
void NewConnection (ola::io::ConnectedDescriptor *descriptor)
 Add a new ConnectedDescriptor to this Server. More...
 
ola::network::GenericSocketAddress LocalRPCAddress () const
 Return the socket address the RPC server is listening on. More...
 
void NewClient (ola::rpc::RpcSession *session)
 Called by the RpcServer when a client connects. More...
 
void ClientRemoved (ola::rpc::RpcSession *session)
 Called by the RpcServer when a client disconnects. More...
 
const std::string InstanceName ()
 Get the instance name. More...
 
const PreferencesFactoryGetPreferencesFactory ()
 Get the preferences factory. More...
 

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.

const PreferencesFactory* ola::OlaServer::GetPreferencesFactory ( )
inline

Get the preferences factory.

Returns
a pointer to the preferences factory
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: