21 #ifndef OLAD_OLASERVER_H_
22 #define OLAD_OLASERVER_H_
34 #include "ola/io/SelectServer.h"
35 #include "ola/network/InterfacePicker.h"
36 #include "ola/network/Socket.h"
37 #include "ola/network/TCPSocketFactory.h"
38 #include "ola/plugin_id.h"
48 #ifdef HAVE_LIBMICROHTTPD
49 typedef class OladHTTPServer OladHTTPServer_t;
51 typedef int OladHTTPServer_t;
61 bool http_localhost_only;
62 bool http_enable_quit;
63 unsigned int http_port;
71 const vector<class PluginLoader*> &plugin_loaders,
83 void ReloadPidStore();
88 void ChannelClosed(
int read_descriptor);
89 bool RunHousekeeping();
91 static const unsigned int DEFAULT_HTTP_PORT = 9090;
99 typedef std::map<int, ClientEntry> ClientMap;
101 class OlaClientServiceFactory *m_service_factory;
102 vector<class PluginLoader*> m_plugin_loaders;
107 auto_ptr<class ExportMap> m_our_export_map;
108 class ExportMap *m_export_map;
109 class PreferencesFactory *m_preferences_factory;
110 class Preferences *m_universe_preferences;
112 auto_ptr<class DeviceManager> m_device_manager;
113 auto_ptr<class PluginManager> m_plugin_manager;
114 auto_ptr<class PluginAdaptor> m_plugin_adaptor;
115 auto_ptr<class UniverseStore> m_universe_store;
116 auto_ptr<class PortManager> m_port_manager;
117 auto_ptr<class OlaServerServiceImpl> m_service_impl;
118 auto_ptr<class ClientBroker> m_broker;
119 auto_ptr<class PortBroker> m_port_broker;
120 auto_ptr<const RootPidStore> m_pid_store;
122 ola::thread::timeout_id m_housekeeping_timeout;
123 ClientMap m_sd_to_service;
124 auto_ptr<OladHTTPServer_t> m_httpd;
125 const Options m_options;
128 #ifdef HAVE_LIBMICROHTTPD
133 void CleanupConnection(ClientEntry client);
134 void ReloadPluginsInternal();
135 void UpdatePidStore(
const RootPidStore *pid_store);
137 OlaServer(
const OlaServer&);
138 OlaServer& operator=(
const OlaServer&);
140 static const char UNIVERSE_PREFERENCES[];
141 static const char K_CLIENT_VAR[];
142 static const char K_UID_VAR[];
143 static const unsigned int K_HOUSEKEEPING_TIMEOUT_MS;
146 #endif // OLAD_OLASERVER_H_