Open Lighting Architecture: plugins/milinst/MilInstPlugin.h Source File

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
MilInstPlugin.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 * MilInstPlugin.h
17 * Interface for the Milford Instruments plugin class
18 * Copyright (C) 2013 Peter Newman
19 */
20
21#ifndef PLUGINS_MILINST_MILINSTPLUGIN_H_
22#define PLUGINS_MILINST_MILINSTPLUGIN_H_
23
24#include <string>
25#include <vector>
26
27#include "ola/io/Descriptor.h"
28#include "olad/Plugin.h"
29
30namespace ola {
31namespace plugin {
32namespace milinst {
33
34class MilInstDevice;
35
36 class MilInstPlugin: public Plugin {
37 public:
38 explicit MilInstPlugin(PluginAdaptor *plugin_adaptor)
39 : Plugin(plugin_adaptor) {}
40
41 ~MilInstPlugin() {}
42
43 std::string Name() const { return PLUGIN_NAME; }
44 ola_plugin_id Id() const { return OLA_PLUGIN_MILINST; }
45 std::string Description() const;
46 int SocketClosed(ola::io::ConnectedDescriptor *socket);
47 std::string PluginPrefix() const { return PLUGIN_PREFIX; }
48
49 private:
50 bool StartHook();
51 bool StopHook();
52 bool SetDefaultPreferences();
53 void DeleteDevice(MilInstDevice *device);
54
55 std::vector<MilInstDevice*> m_devices; // list of our devices
56
57 static const char MILINST_DEVICE_PATH[];
58 static const char PLUGIN_NAME[];
59 static const char PLUGIN_PREFIX[];
60 static const char DEVICE_KEY[];
61};
62} // namespace milinst
63} // namespace plugin
64} // namespace ola
65#endif // PLUGINS_MILINST_MILINSTPLUGIN_H_
ola::PluginAdaptor
Definition PluginAdaptor.h:41
ola::Plugin::SetDefaultPreferences
virtual bool SetDefaultPreferences()
Definition Plugin.h:159
ola::io::ConnectedDescriptor
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition Descriptor.h:283
ola::plugin::milinst::MilInstDevice
Definition MilInstDevice.h:36
ola::plugin::milinst::MilInstPlugin::Name
std::string Name() const
Get the plugin name.
Definition MilInstPlugin.h:43
ola::plugin::milinst::MilInstPlugin::Description
std::string Description() const
Definition MilInstPlugin.cpp:98
ola::plugin::milinst::MilInstPlugin::PluginPrefix
std::string PluginPrefix() const
The prefix to use for storing configuration files.
Definition MilInstPlugin.h:47
ola::plugin::milinst::MilInstPlugin::Id
ola_plugin_id Id() const
Get the plugin ID of this plugin.
Definition MilInstPlugin.h:44
Descriptor.h
ola::plugin::milinst
Code for Milford Instruments devices.
ola::plugin
Code for supported devices and protocols.
ola
The namespace containing all OLA symbols.
Definition Credentials.cpp:44