Open Lighting Architecture  0.9.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RenardPlugin.h
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
15  *
16  * RenardPlugin.h
17  * Interface for the Renard plugin class
18  * Copyright (C) 2013 Hakan Lindestaf
19  */
20 
21 #ifndef PLUGINS_RENARD_RENARDPLUGIN_H_
22 #define PLUGINS_RENARD_RENARDPLUGIN_H_
23 
24 #include <string>
25 #include <vector>
26 
27 #include "ola/io/Descriptor.h"
28 #include "olad/Plugin.h"
29 
30 namespace ola {
31 namespace plugin {
32 namespace renard {
33 
34 class RenardDevice;
35 
36 class RenardPlugin: public Plugin {
37  public:
38  explicit RenardPlugin(PluginAdaptor *plugin_adaptor)
39  : Plugin(plugin_adaptor) {}
40  ~RenardPlugin() {}
41 
42  std::string Name() const { return PLUGIN_NAME; }
43  ola_plugin_id Id() const { return OLA_PLUGIN_RENARD; }
44  std::string Description() const;
45  int SocketClosed(ola::io::ConnectedDescriptor *socket);
46  std::string PluginPrefix() const { return PLUGIN_PREFIX; }
47 
48  private:
49  bool StartHook();
50  bool StopHook();
51  bool SetDefaultPreferences();
52  void DeleteDevice(RenardDevice *device);
53 
54  std::vector<RenardDevice*> m_devices; // list of our devices
55 
56  static const char RENARD_DEVICE_PATH[];
57  static const char RENARD_BASE_DEVICE_NAME[];
58  static const char RENARD_SS_DEVICE_NAME[];
59  static const char PLUGIN_NAME[];
60  static const char PLUGIN_PREFIX[];
61  static const char DEVICE_KEY[];
62 };
63 } // namespace renard
64 } // namespace plugin
65 } // namespace ola
66 #endif // PLUGINS_RENARD_RENARDPLUGIN_H_