#include <nap/device.h>
Public Member Functions | |
virtual bool | start (utility::ErrorState &errorState) |
virtual void | stop () |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Special type of Resource that represents a device. Only 1 instance of a device is allowed to run at the same time. For example: If you have a device that opens a specific port, that port can't be opened twice. Initialization should fail because of this reason. The solution is to start() and stop() the device when 2 (or more) instances of that same device exist during the real-time edit fase. In this specific case the port is closed when the device is stopped (first instance) before being opened on start (second instance).
The Device class deals with this case by providing an explicit start / stop virtual, which are called at appropriate times by the ResourceManager. It's important that both start & stop can be called multiple times. start is always called before stop. stop is only called when start succeeded.
|
virtual |
Start the device. Called after initialization. When called it is safe to assume that all dependencies have been resolved up to this point.
errorState | The error state |
Reimplemented in UDPThread, UDPAdapter, VideoPlayer, SequencePlayer, SerialPort, RenderTag, OSCSender, ArtNetReceiver, OSCReceiver, MidiOutputPort, MidiInputPort, ArtNetController, SecureWebSocketClientEndPoint, WebSocketClientEndPointSetup< config >, and WebSocketClientEndPointSetup< wspp::ConfigTLS >.
|
virtual |
Called when the device needs to be stopped, but only if start has previously been called on this Device. It is safe to assume that when stop is called the device is in a 'started' state. Called in reverse init order.
Reimplemented in UDPThread, UDPAdapter, VideoPlayer, SequencePlayer, SerialPort, ArtNetController, RenderTag, OSCSender, WebSocketClientEndPointSetup< config >, WebSocketClientEndPointSetup< wspp::ConfigTLS >, ArtNetReceiver, OSCReceiver, MidiOutputPort, and MidiInputPort.