Open Lighting Architecture  0.9.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ola::rdm::RootPidStore Class Reference

Detailed Description

The root of the RDM parameter descriptor store.

The root parameter store holds the PLASA (formerly known as ESTA) parameters as well as any manufacturer defined parameters. Parameter definitions are loaded from .proto files, which are generated by the http://rdm.openlighting.org site.

Each parameter has an 16bit identifier (PID).

PLASA PIDs are those defined by the E1.X series of documents. To date this includes:

Public Types

typedef std::map< uint16_t,
const PidStore * > 
ManufacturerMap

Public Member Functions

 RootPidStore (const PidStore *esta_store, const ManufacturerMap &manufacturer_stores, uint64_t version=0)
 Create a new RootPidStore.
uint64_t Version () const
 The version of the RDM parameter data.
const PidStoreEstaStore () const
 Return the PidStore for PLASA (ESTA) parameters.
const PidStoreManufacturerStore (uint16_t esta_id) const
 Return the PidStore for a manufacturer.
const PidDescriptorGetDescriptor (const std::string &pid_name) const
 Lookup a PLASA-defined parameter by name.
const PidDescriptorGetDescriptor (const std::string &pid_name, uint16_t manufacturer_id) const
 Lookup a parameter by name in both the PLASA and the specified manufacturer store.
const PidDescriptorGetDescriptor (uint16_t pid_value) const
 Look up a PLASA-defined parameter by PID.
const PidDescriptorGetDescriptor (uint16_t pid_value, uint16_t manufacturer_id) const
 Lookup a parameter by PID in both the PLASA and the specified manufacturer store.

Static Public Member Functions

static const RootPidStoreLoadFromFile (const std::string &file, bool validate=true)
 Load a RootPidStore from a file.
static const RootPidStoreLoadFromDirectory (const std::string &directory, bool validate=true)
 Load a RootPidStore from a directory.
static const std::string DataLocation ()
 Returns the location of the installed PID data.

Constructor & Destructor Documentation

ola::rdm::RootPidStore::RootPidStore ( const PidStore esta_store,
const ManufacturerMap &  manufacturer_stores,
uint64_t  version = 0 
)
inline

Create a new RootPidStore.

Most code shouldn't have to use this. Use RootPidStore::LoadFromFile or RootPidStore::LoadFromDirectory instead.

Member Function Documentation

const string ola::rdm::RootPidStore::DataLocation ( )
static

Returns the location of the installed PID data.

Returns
the directory where the pid data was installed.
const PidStore* ola::rdm::RootPidStore::EstaStore ( ) const
inline

Return the PidStore for PLASA (ESTA) parameters.

Returns
the PidStore for the PLASA parameters. The pointer is valid for the lifetime of the RootPidStore.
const PidDescriptor * ola::rdm::RootPidStore::GetDescriptor ( const std::string &  pid_name) const

Lookup a PLASA-defined parameter by name.

Parameters
pid_namethe name of the parameter.
Returns
a PidDescriptor or NULL if the parameter wasn't found.
const PidDescriptor * ola::rdm::RootPidStore::GetDescriptor ( const std::string &  pid_name,
uint16_t  manufacturer_id 
) const

Lookup a parameter by name in both the PLASA and the specified manufacturer store.

Parameters
pid_namethe name of the parameter to look for.
manufacturer_idthe ESTA id of the manufacturer.
Returns
a PidDescriptor or NULL if the parameter wasn't found.
const PidDescriptor * ola::rdm::RootPidStore::GetDescriptor ( uint16_t  pid_value) const

Look up a PLASA-defined parameter by PID.

Parameters
pid_valuethe PID to lookup.
Returns
a PidDescriptor or NULL if the parameter wasn't found.
const PidDescriptor * ola::rdm::RootPidStore::GetDescriptor ( uint16_t  pid_value,
uint16_t  manufacturer_id 
) const

Lookup a parameter by PID in both the PLASA and the specified manufacturer store.

Parameters
pid_valuethe pid to lookup
manufacturer_idthe ESTA id of the manufacturer.
Returns
a PidDescriptor or NULL if the parameter wasn't found.
const RootPidStore * ola::rdm::RootPidStore::LoadFromDirectory ( const std::string &  directory,
bool  validate = true 
)
static

Load a RootPidStore from a directory.

Parameters
directorythe directory containing the PID data. If directory is empty, the installed location will be used.
validatewhether to perform validation on the data. Validation can be turned off for faster load times.
const RootPidStore * ola::rdm::RootPidStore::LoadFromFile ( const std::string &  file,
bool  validate = true 
)
static

Load a RootPidStore from a file.

Parameters
filethe file to load
validatewhether to perform validation on the data. Validation can be turned off for faster load times.
const PidStore * ola::rdm::RootPidStore::ManufacturerStore ( uint16_t  esta_id) const

Return the PidStore for a manufacturer.

Parameters
esta_idthe manufacturer id.
Returns
A pointer to a PidStore or NULL if there were no parameters for this manufacturer.
uint64_t ola::rdm::RootPidStore::Version ( ) const
inline

The version of the RDM parameter data.

Returns
The version of the parameter data. A higher number is a more recent version.

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