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;
230 const PidDescriptor *LookupPID(
const std::string &pid_name)
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;
287 bool IsGetValid(uint16_t sub_device)
const;
288 bool IsSetValid(uint16_t sub_device)
const;
293 const std::string m_name;
294 uint16_t m_pid_value;
299 sub_device_validator m_get_subdevice_range;
300 sub_device_validator m_set_subdevice_range;
302 bool RequestValid(uint16_t sub_device,
303 const sub_device_validator &validator)
const;
309 #endif // INCLUDE_OLA_RDM_PIDSTORE_H_ Holds the PidDescriptors for a single manufacturer.
Definition: PidStore.h:186
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Creates dummy copy constructor and assignment operator declarations.
Definition: Macro.h:44
static const RootPidStore * LoadFromFile(const std::string &file, bool validate=true)
Load a RootPidStore from a file.
Definition: PidStore.cpp:109
const PidStore * ManufacturerStore(uint16_t esta_id) const
Return the PidStore for a manufacturer.
Definition: PidStore.cpp:41
unsigned int PidCount() const
The number of PidDescriptors in this store.
Definition: PidStore.h:207
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 PidStore * EstaStore() const
Return the PidStore for ESTA (PLASA) parameters.
Definition: PidStore.h:100
Definition: Descriptor.h:403
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
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
RootPidStore(const PidStore *esta_store, const ManufacturerMap &manufacturer_stores, uint64_t version=0)
Create a new RootPidStore.
Definition: PidStore.h:78
const PidDescriptor * GetDescriptor(const std::string &pid_name) const
Lookup an ESTA-defined parameter by name.
Definition: PidStore.cpp:48
Definition: PidStore.h:246