|
Astarte device API for C++ 0.8.1
Astarte device SDK for C++
|
Astarte object class, representing the Astarte object datastream data. More...
#include <object.hpp>
Public Types | |
| using | MapType = std::unordered_map<std::string, Data> |
| Helper type for the map of paths and Astarte datas. | |
| using | iterator = MapType::iterator |
| Helper type for the iterator over the map of paths and Astarte datas. | |
| using | const_iterator = MapType::const_iterator |
| Helper type for the const iterator over the map of paths and Astarte datas. | |
| using | size_type = MapType::size_type |
| Helper type for size type of the map of paths and Astarte datas. | |
| using | value_type = MapType::value_type |
| Helper type for value type of the map of paths and Astarte datas. | |
Public Member Functions | |
| DatastreamObject () | |
| Constructs an empty DatastreamObject. | |
| DatastreamObject (std::initializer_list< value_type > init) | |
| Constructs a DatastreamObject with initial content. | |
| auto | at (const std::string &key) -> Data & |
| Accesses the specified element with bounds checking. | |
| auto | at (const std::string &key) const -> const Data & |
| Accesses the specified element with bounds checking. | |
| auto | begin () -> iterator |
| Returns an iterator to the beginning of the map. | |
| auto | begin () const -> const_iterator |
| Returns an iterator to the beginning of the map. | |
| auto | end () -> iterator |
| Returns an iterator to the end of the map. | |
| auto | end () const -> const_iterator |
| Returns an iterator to the end of the map. | |
| auto | size () const -> size_type |
| Returns the number of elements in the map. | |
| auto | empty () const -> bool |
| Checks if the map is empty. | |
| void | insert (const std::string &key, const Data &data) |
| Inserts elements into the map. | |
| auto | erase (const std::string &key) -> size_type |
| Erases elements from the map. | |
| void | clear () |
| Clears the contents of the map. | |
| auto | find (const std::string &key) -> iterator |
| Finds an element with a specific key. | |
| auto | find (const std::string &key) const -> const_iterator |
| Finds an element with a specific key. | |
| auto | get_raw_data () const -> const MapType & |
| Returns the raw data contained in this class instance. | |
| auto | operator== (const DatastreamObject &other) const -> bool |
| Overloader for the comparison operator ==. | |
| auto | operator!= (const DatastreamObject &other) const -> bool |
| Overloader for the comparison operator !=. | |
Astarte object class, representing the Astarte object datastream data.
This class acts as a specialized container for mapping relative paths (keys) to Astarte Data values. It is primarily used when transmitting data via interfaces configured with object aggregation.
| using astarte::device::DatastreamObject::const_iterator = MapType::const_iterator |
Helper type for the const iterator over the map of paths and Astarte datas.
| using astarte::device::DatastreamObject::iterator = MapType::iterator |
Helper type for the iterator over the map of paths and Astarte datas.
| using astarte::device::DatastreamObject::MapType = std::unordered_map<std::string, Data> |
Helper type for the map of paths and Astarte datas.
| using astarte::device::DatastreamObject::size_type = MapType::size_type |
Helper type for size type of the map of paths and Astarte datas.
| using astarte::device::DatastreamObject::value_type = MapType::value_type |
Helper type for value type of the map of paths and Astarte datas.
| astarte::device::DatastreamObject::DatastreamObject | ( | ) |
Constructs an empty DatastreamObject.
| astarte::device::DatastreamObject::DatastreamObject | ( | std::initializer_list< value_type > | init | ) |
Constructs a DatastreamObject with initial content.
| [in] | init | The initialize list to use as initial content. |
| auto astarte::device::DatastreamObject::at | ( | const std::string & | key | ) | -> Data & |
Accesses the specified element with bounds checking.
Soft wrapper for the equivalent method in the std::unordered_map.
| [in] | key | The key to search for. |
| auto astarte::device::DatastreamObject::at | ( | const std::string & | key | ) | const -> const Data & |
Accesses the specified element with bounds checking.
Soft wrapper for the equivalent method in the std::unordered_map.
| [in] | key | The key to search for. |
| auto astarte::device::DatastreamObject::begin | ( | ) | -> iterator |
Returns an iterator to the beginning of the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| auto astarte::device::DatastreamObject::begin | ( | ) | const -> const_iterator |
Returns an iterator to the beginning of the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| void astarte::device::DatastreamObject::clear | ( | ) |
Clears the contents of the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| auto astarte::device::DatastreamObject::empty | ( | ) | const -> bool |
Checks if the map is empty.
Soft wrapper for the equivalent method in the std::unordered_map.
| auto astarte::device::DatastreamObject::end | ( | ) | -> iterator |
Returns an iterator to the end of the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| auto astarte::device::DatastreamObject::end | ( | ) | const -> const_iterator |
Returns an iterator to the end of the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| auto astarte::device::DatastreamObject::erase | ( | const std::string & | key | ) | -> size_type |
Erases elements from the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| [in] | key | The key of the element to erase. |
| auto astarte::device::DatastreamObject::find | ( | const std::string & | key | ) | -> iterator |
Finds an element with a specific key.
Soft wrapper for the equivalent method in the std::unordered_map.
| [in] | key | The key to find. |
| auto astarte::device::DatastreamObject::find | ( | const std::string & | key | ) | const -> const_iterator |
Finds an element with a specific key.
Soft wrapper for the equivalent method in the std::unordered_map.
| [in] | key | The key to find. |
| auto astarte::device::DatastreamObject::get_raw_data | ( | ) | const -> const MapType & |
Returns the raw data contained in this class instance.
| void astarte::device::DatastreamObject::insert | ( | const std::string & | key, |
| const Data & | data ) |
Inserts elements into the map.
Soft wrapper for the equivalent method in the std::unordered_map.
| [in] | key | The key to insert. |
| [in] | data | The value to insert. |
|
nodiscard |
Overloader for the comparison operator !=.
| [in] | other | The object to compare to. |
|
nodiscard |
Overloader for the comparison operator ==.
| [in] | other | The object to compare to. |
| auto astarte::device::DatastreamObject::size | ( | ) | const -> size_type |
Returns the number of elements in the map.
Soft wrapper for the equivalent method in the std::unordered_map.