29 #ifndef INCLUDE_OLA_RDM_PIDSTORE_H_
30 #define INCLUDE_OLA_RDM_PIDSTORE_H_
33 #include <ola/messaging/Descriptor.h>
70 typedef std::map<uint16_t, const PidStore*> ManufacturerMap;
79 const ManufacturerMap &manufacturer_stores,
81 : m_esta_store(esta_store),
82 m_manufacturer_store(manufacturer_stores),
93 uint64_t
Version()
const {
return m_version; }
101 return m_esta_store.get();
127 uint16_t manufacturer_id)
const;
144 uint16_t manufacturer_id)
const;
153 bool validate =
true);
163 bool validate =
true);
172 std::auto_ptr<const PidStore> m_esta_store;
173 ManufacturerMap m_manufacturer_store;
177 const std::string &pid_name)
const;
196 explicit PidStore(
const std::vector<const PidDescriptor*> &pids);
207 unsigned int PidCount()
const {
return m_pid_by_value.size(); }
216 void AllPids(std::vector<const PidDescriptor*> *pids)
const;
233 typedef std::map<uint16_t, const PidDescriptor*> PidMap;
234 typedef std::map<std::string, const PidDescriptor*> PidNameMap;
235 PidMap m_pid_by_value;
236 PidNameMap m_pid_by_name;
253 NON_BROADCAST_SUB_DEVICE,
255 } sub_device_validator;
263 sub_device_validator get_sub_device_range,
264 sub_device_validator set_sub_device_range)
267 m_get_request(get_request),
268 m_get_response(get_response),
269 m_set_request(set_request),
270 m_set_response(set_response),
271 m_get_subdevice_range(get_sub_device_range),
272 m_set_subdevice_range(set_sub_device_range) {
276 const std::string &Name()
const {
return m_name; }
277 uint16_t Value()
const {
return m_pid_value; }
280 return m_get_response;
284 return m_set_response;
291 const std::string m_name;
292 uint16_t m_pid_value;
297 sub_device_validator m_get_subdevice_range;
298 sub_device_validator m_set_subdevice_range;
300 bool RequestValid(uint16_t sub_device,
301 const sub_device_validator &validator)
const;
307 #endif // INCLUDE_OLA_RDM_PIDSTORE_H_
Holds the PidDescriptors for a single manufacturer.
Definition: PidStore.h:186
~PidStore()
Clean up.
Definition: PidStore.cpp:139
const PidStore * ManufacturerStore(uint16_t esta_id) const
Return the PidStore for a manufacturer.
Definition: PidStore.cpp:41
static const RootPidStore * LoadFromFile(const std::string &file, bool validate=true)
Load a RootPidStore from a file.
Definition: PidStore.cpp:109
uint64_t Version() const
The version of the RDM parameter data.
Definition: PidStore.h:93
static const RootPidStore * LoadFromDirectory(const std::string &directory, bool validate=true)
Load a RootPidStore from a directory.
Definition: PidStore.cpp:115
const PidDescriptor * GetDescriptor(const std::string &pid_name) const
Lookup a PLASA-defined parameter by name.
Definition: PidStore.cpp:48
PidStore(const std::vector< const PidDescriptor * > &pids)
Create a new PidStore with the given PidDescriptors.
Definition: PidStore.cpp:131
void AllPids(std::vector< const PidDescriptor * > *pids) const
Return a list of all PidDescriptors.
Definition: PidStore.cpp:144
const PidStore * EstaStore() const
Return the PidStore for PLASA (ESTA) parameters.
Definition: PidStore.h:100
unsigned int PidCount() const
The number of PidDescriptors in this store.
Definition: PidStore.h:207
const PidDescriptor * LookupPID(uint16_t pid_value) const
Lookup a PidDescriptor by PID.
Definition: PidStore.cpp:169
Definition: Descriptor.h:399
bool IsGetValid(uint16_t sub_device) const
Definition: PidStore.cpp:196
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
bool IsSetValid(uint16_t sub_device) const
Definition: PidStore.cpp:206
The root of the RDM parameter descriptor store.
Definition: PidStore.h:68
static const std::string DataLocation()
Returns the location of the installed PID data.
Definition: PidStore.cpp:126
~PidDescriptor()
Definition: PidStore.cpp:157
RootPidStore(const PidStore *esta_store, const ManufacturerMap &manufacturer_stores, uint64_t version=0)
Create a new RootPidStore.
Definition: PidStore.h:78
Definition: PidStore.h:246