Lumiverse  2.5
A framework for creating lighting control applications
Public Member Functions | List of all members
Lumiverse::Patch Class Referenceabstract

A Patch maps devices to output channels and handles the output of data to the network. More...

#include <Patch.h>

Inheritance diagram for Lumiverse::Patch:
Inheritance graph
[legend]

Public Member Functions

virtual ~Patch ()
 Virtual destructor.
 
virtual void update (set< Device * > devices)=0
 Grabs values from list of Devices, translates them to proper format for the given network, and outputs the values to the network if the device is patched. More...
 
virtual void init ()=0
 Initializes settings for the patch. More...
 
virtual void close ()=0
 Prepares for patch shutdown.
 
virtual JSONNode toJSON ()=0
 Returns a JSON node representing the patch. More...
 
virtual string getType ()=0
 Gets the type of the patch as a string. More...
 
virtual void deleteDevice (string id)=0
 Called when a device is deleted from the Rig. More...
 

Detailed Description

A Patch maps devices to output channels and handles the output of data to the network.

Patches do not expose the internal workings of their network transport to the Rig. The user may choose to configure a Patch in a particular way, but the Rig doesn't care as long as it can pass Device objects to a Patch. The root Patch class is an abstract base class that defines the actions all implementations of a Patch must have.

Member Function Documentation

virtual void Lumiverse::Patch::deleteDevice ( string  id)
pure virtual

Called when a device is deleted from the Rig.

Patches should clean up information about the device in question.

Implemented in Lumiverse::SimulationPatch, Lumiverse::DMXPatch, and Lumiverse::OscPatch.

virtual string Lumiverse::Patch::getType ( )
pure virtual

Gets the type of the patch as a string.

This function should be hardcoded to return a string. This allows each object to be uniquely identified by a single string and allows the user to then do more detailed manipulation of the Patch.

Returns
String representing the type of the Patch

Implemented in Lumiverse::ArnoldPatch, Lumiverse::ArnoldPatch, Lumiverse::SimulationPatch, Lumiverse::DMXPatch, Lumiverse::ArnoldAnimationPatch, and Lumiverse::OscPatch.

virtual void Lumiverse::Patch::init ( )
pure virtual

Initializes settings for the patch.

This can be starting up serial interfaces, network configuration, etc.

See also
Rig::init()

Implemented in Lumiverse::ArnoldPatch, Lumiverse::ArnoldPatch, Lumiverse::SimulationPatch, Lumiverse::DMXPatch, Lumiverse::ArnoldAnimationPatch, and Lumiverse::OscPatch.

virtual JSONNode Lumiverse::Patch::toJSON ( )
pure virtual

Returns a JSON node representing the patch.

This is necessary for proper serialization of the Patch when the Rig is serialied. If you don't want your Patch to be serializable for some reason, you can return an empty JSONNode

Returns
JSONNode containing the data for the Patch
See also
Rig::loadPatches(), Rig::save()

Implemented in Lumiverse::ArnoldPatch, Lumiverse::ArnoldPatch, Lumiverse::SimulationPatch, Lumiverse::DMXPatch, and Lumiverse::OscPatch.

virtual void Lumiverse::Patch::update ( set< Device * >  devices)
pure virtual

Grabs values from list of Devices, translates them to proper format for the given network, and outputs the values to the network if the device is patched.

Each Patch will get the full list of Devices from the Rig. The Patch implementation is responsible for finding the Devices that it needs, and then transmitting the apropriate data over the network. Each Patch may do this differently depending on the needs of the network.

Implemented in Lumiverse::ArnoldPatch, Lumiverse::ArnoldAnimationPatch, Lumiverse::ArnoldPatch, Lumiverse::SimulationPatch, Lumiverse::DMXPatch, and Lumiverse::OscPatch.


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