21 #ifndef INCLUDE_OLAD_DEVICE_H_ 22 #define INCLUDE_OLAD_DEVICE_H_ 25 #include <olad/Port.h> 52 virtual const std::string Name()
const = 0;
61 virtual std::string UniqueId()
const = 0;
64 virtual bool Stop() = 0;
67 virtual bool AllowLooping()
const = 0;
73 virtual bool AllowMultiPortPatching()
const = 0;
76 virtual void InputPorts(std::vector<InputPort*> *ports)
const = 0;
77 virtual void OutputPorts(std::vector<OutputPort*> *ports)
const = 0;
80 virtual InputPort *GetInputPort(
unsigned int port_id)
const = 0;
82 virtual OutputPort *GetOutputPort(
unsigned int port_id)
const = 0;
86 const std::string &request,
87 std::string *response,
88 ConfigureCallback *done) = 0;
100 const std::string
Name()
const {
return m_name; }
103 void SetName(
const std::string &name) { m_name = name; }
106 std::string UniqueId()
const;
112 virtual std::string DeviceId()
const = 0;
114 bool IsEnabled()
const {
return m_enabled; }
126 void InputPorts(std::vector<InputPort*> *ports)
const;
127 void OutputPorts(std::vector<OutputPort*> *ports)
const;
129 InputPort *GetInputPort(
unsigned int port_id)
const;
130 OutputPort *GetOutputPort(
unsigned int port_id)
const;
133 void DeleteAllPorts();
137 const std::string &request,
138 std::string *response,
148 virtual void PrePortStop() {}
149 virtual void PostPortStop() {}
152 typedef std::map<unsigned int, InputPort*> input_port_map;
153 typedef std::map<unsigned int, OutputPort*> output_port_map;
158 mutable std::string m_unique_id;
159 input_port_map m_input_ports;
160 output_port_map m_output_ports;
162 template<
class PortClass>
163 bool GenericAddPort(PortClass *port,
164 std::map<unsigned int, PortClass*> *ports);
166 template <
class PortClass>
167 void GenericDeletePort(PortClass *p);
172 #endif // INCLUDE_OLAD_DEVICE_H_ AbstractPlugin * Owner() const
The Plugin that owns this Device.
Definition: Device.h:105
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
bool AllowMultiPortPatching() const
Allow multiple ports of the same type to be patched to the same universe.
Definition: Device.h:122
const std::string Name() const
The name of this Device.
Definition: Device.h:100
A port that sends DMX512 data.
Definition: Port.h:163
virtual bool StartHook()
Called during Start().
Definition: Device.h:147
The interface for a Device.
Definition: Device.h:44
bool AllowLooping() const
Allow input and output ports to be patched to the same universe.
Definition: Device.h:121
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
A RpcController object is passed every time an RPC is invoked and is used to indicate the success or ...
Definition: RpcController.h:42
void SetName(const std::string &name)
Sets the name of this Device.
Definition: Device.h:103