Open Lighting Architecture: ola::OlaServer Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
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:

## 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.
| ~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.
const PreferencesFactory * | GetPreferencesFactory ()
| Get the preferences factory.

## Static Public Attributes
static const unsigned int | DEFAULT_HTTP_PORT = 9090
static const unsigned int | DEFAULT_RPC_PORT = OLA_DEFAULT_PORT

## Constructor & Destructor Documentation

## ◆ OlaServer()

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_loaders | A list of PluginLoaders to use to find plugins.
  preferences_factory | The factory to use when creating Preference objects.
  ss | The SelectServer.
  ola_options | The OlaServer options.
  socket | An optional TCPAcceptingSocket in the listen state to use for client RPC calls. Ownership is transferred.
  export_map | An optional ExportMap. If set to NULL a new ExportMap will be created.

## Member Function Documentation

## ◆ ClientRemoved()

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

Called by the RpcServer when a client disconnects.

Parameters

  session | the RpcSession for the client.

Implements ola::rpc::RpcSessionHandlerInterface.

## ◆ GetPreferencesFactory()

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

Get the preferences factory.

Returns
  a pointer to the preferences factory

## ◆ Init()

bool ola::OlaServer::Init | ( |  | ) |

Initialize the OlaServer.

Returns
  true if initialization succeeded, false if it failed.

## ◆ InstanceName()

const std::string ola::OlaServer::InstanceName | ( |  | ) |
| inline

Get the instance name.

Returns
  a string which is the instance name

## ◆ LocalRPCAddress()

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.

## ◆ NewClient()

void ola::OlaServer::NewClient | ( | ola::rpc::RpcSession * | session | ) |
| virtual

Called by the RpcServer when a client connects.

Parameters

  session | the RpcSession for the client.

Implements ola::rpc::RpcSessionHandlerInterface.

## ◆ NewConnection()

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

Add a new ConnectedDescriptor to this Server.

Parameters

  descriptor | the new ConnectedDescriptor, ownership is transferred.

## ◆ ReloadPidStore()

void ola::OlaServer::ReloadPidStore | ( |  | ) |

Reload the pid store.

This method is thread safe.

## ◆ ReloadPlugins()

void ola::OlaServer::ReloadPlugins | ( |  | ) |

Reload all plugins.

This method is thread safe.

## ◆ StopServer()

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:

- olad/OlaServer.h
- olad/OlaServer.cpp