43 #include "access_method.h"
71 Entry(
const uint16_t _index,
const uint8_t _subindex,
const std::string& _name,
const Type _type,
const AccessType _access_type);
162 bool m_valid =
false;
165 std::vector<ValueChangedCallback> m_value_changed_callbacks;
166 std::unique_ptr<std::mutex> m_value_changed_callbacks_mutex;
171 std::unique_ptr<std::recursive_mutex> m_read_write_mutex;
Type get_type() const
Returns the data type.
void add_value_changed_callback(ValueChangedCallback callback)
Registers a given function to be called when the value is changed.
Type type
Data type of the value.
std::function< void(const Value &value) > ValueChangedCallback
type of a callback for a value changed event Important: Never call add_value_changed_callback() from ...
const Value & get_value() const
Returns the value.
Entry & operator=(const Entry &other)=delete
copy assignment
WriteAccessMethod write_access_method
Standard method for writing this entry. Used by Device::set_entry().
void set_value(const Value &value)
Sets the value.
AccessType access_type
Accessibility of the entry.
uint16_t index
index in dictionary
std::string name
Human-readable name Should be escaped for consitency using Utils::escape().
uint8_t subindex
subindex in dictionary. if is_array==true, this variable is not used
bool disabled
Disables this entry. This is used when a device reports "Object does not exist in the object dictiona...
bool is_generic
This is set to true, if the entry has been created through a default CiA EDS file. This means that it's not guaranteed that the entry actually exists in the current device. For manually added entries and entries from manufacturer-specific EDS files, this is set to false.
ReadAccessMethod read_access_method
Standard method for reading this entry. Used by Device::get_entry().
bool valid() const
Returns if the value is set/valid.
bool operator<(const Entry &other) const
Compares entries by index and subindex. This can be used for sorting the dictionary.
This class represents an entry in the object dictionary of a device.
void print() const
Prints relevant information concerning this entry on standard output - name, index, possibly value, ... This is used by Device::print_dictionary()
Entry()
Constructs an empty entry.
This class contains a value to be stored in the object dictionary. The value can have one of the type...