Open Lighting Architecture  Latest Git
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
ola::Universe Class Reference
Inheritance diagram for ola::Universe:
Inheritance graph
[legend]
Collaboration diagram for ola::Universe:
Collaboration graph
[legend]

Public Types

enum  merge_mode { MERGE_HTP, MERGE_LTP }
 

Public Member Functions

 Universe (unsigned int uid, class UniverseStore *store, ExportMap *export_map, Clock *clock)
 
std::string Name () const
 
unsigned int UniverseId () const
 
merge_mode MergeMode () const
 
bool IsActive () const
 
uint8_t ActivePriority () const
 
const TimeIntervalRDMDiscoveryInterval () const
 Return the time between RDM discovery operations. More...
 
const TimeStampLastRDMDiscovery () const
 Get the time of the last discovery run.
 
void SetName (const std::string &name)
 
void SetMergeMode (merge_mode merge_mode)
 
void SetRDMDiscoveryInterval (const TimeInterval &discovery_interval)
 
bool SetDMX (const DmxBuffer &buffer)
 
const DmxBufferGetDMX () const
 
bool AddPort (InputPort *port)
 
bool AddPort (OutputPort *port)
 
bool RemovePort (InputPort *port)
 
bool RemovePort (OutputPort *port)
 
bool ContainsPort (InputPort *port) const
 
bool ContainsPort (OutputPort *port) const
 
unsigned int InputPortCount () const
 
unsigned int OutputPortCount () const
 
void InputPorts (std::vector< InputPort *> *ports) const
 
void OutputPorts (std::vector< OutputPort *> *ports) const
 
bool AddSourceClient (Client *client)
 
bool RemoveSourceClient (Client *client)
 
bool ContainsSourceClient (Client *client) const
 
unsigned int SourceClientCount () const
 
bool AddSinkClient (Client *client)
 
bool RemoveSinkClient (Client *client)
 
bool ContainsSinkClient (Client *client) const
 
unsigned int SinkClientCount () const
 
bool PortDataChanged (InputPort *port)
 
bool SourceClientDataChanged (Client *client)
 
void CleanStaleSourceClients ()
 Clean old source clients.
 
void SendRDMRequest (ola::rdm::RDMRequest *request, ola::rdm::RDMCallback *callback)
 Send a RDM command. More...
 
void RunRDMDiscovery (ola::rdm::RDMDiscoveryCallback *on_complete, bool full=true)
 
void NewUIDList (OutputPort *port, const ola::rdm::UIDSet &uids)
 
void GetUIDs (ola::rdm::UIDSet *uids) const
 
unsigned int UIDCount () const
 
uint8_t GetRDMTransactionNumber ()
 
bool operator== (const Universe &other)
 

Static Public Attributes

static const char K_FPS_VAR [] = "universe-dmx-frames"
 
static const char K_MERGE_HTP_STR [] = "htp"
 
static const char K_MERGE_LTP_STR [] = "ltp"
 
static const char K_UNIVERSE_INPUT_PORT_VAR [] = "universe-input-ports"
 
static const char K_UNIVERSE_MODE_VAR [] = "universe-mode"
 
static const char K_UNIVERSE_NAME_VAR [] = "universe-name"
 
static const char K_UNIVERSE_OUTPUT_PORT_VAR [] = "universe-output-ports"
 
static const char K_UNIVERSE_RDM_REQUESTS [] = "universe-rdm-requests"
 
static const char K_UNIVERSE_SINK_CLIENTS_VAR [] = "universe-sink-clients"
 
static const char K_UNIVERSE_SOURCE_CLIENTS_VAR []
 
static const char K_UNIVERSE_UID_COUNT_VAR [] = "universe-uids"
 

Member Function Documentation

◆ GetRDMTransactionNumber()

uint8_t ola::Universe::GetRDMTransactionNumber ( )

Return the RDM transaction number to use

◆ RDMDiscoveryInterval()

const TimeInterval& ola::Universe::RDMDiscoveryInterval ( ) const
inline

Return the time between RDM discovery operations.

Returns
the amount of time in seconds between RDM discovery runs. A value of 0 means that periodic discovery is disabled for this universe.

◆ SendRDMRequest()

void ola::Universe::SendRDMRequest ( ola::rdm::RDMRequest request,
ola::rdm::RDMCallback on_complete 
)
virtual

Send a RDM command.

Parameters
requestthe RDMRequest, ownership is transferred.
on_completeThe callback to run when the request completes.

Implementors much ensure that the callback is always run at some point. In other words, there must be no way that a request can be dropped in such a way that the callback is never run. Doing so will either block all subsequent requests, or leak memory depending on the implementation.

Also the implementor of this class may want to re-write the transaction #, and possibly the UID (changing src UIDs isn't addressed by the RDM spec).

The RDMRequest may be a DISCOVERY_COMMAND, if the implementation does not support DISCOVERY_COMMANDs then the callback should be run with ola::rdm::RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED.

Implements ola::rdm::RDMControllerInterface.

◆ SetRDMDiscoveryInterval()

void ola::Universe::SetRDMDiscoveryInterval ( const TimeInterval discovery_interval)
inline

Set the time between periodic RDM discovery operations.

◆ UIDCount()

unsigned int ola::Universe::UIDCount ( ) const

Return the number of uids in the universe

Member Data Documentation

◆ K_UNIVERSE_SOURCE_CLIENTS_VAR

const char ola::Universe::K_UNIVERSE_SOURCE_CLIENTS_VAR
static
Initial value:
=
"universe-source-clients"

The documentation for this class was generated from the following files: