Astarte device API for C++ 0.7.1
Astarte device SDK for C++
Loading...
Searching...
No Matches
AstarteDeviceSdk::AstarteDatastreamObject Class Reference

Astarte object class, representing the Astarte object datastream data. More...

#include <object.hpp>

Public Types

using MapType = std::unordered_map<std::string, AstarteData>
 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

 AstarteDatastreamObject ()
 Constructor for the class. To instantiate an empty object.
 
 AstarteDatastreamObject (std::initializer_list< value_type > init)
 Constructor for the class. To instantiate a non-empty object.
 
auto at (const std::string &key) -> AstarteData &
 Access specified element with bounds checking.
 
auto at (const std::string &key) const -> const AstarteData &
 Access specified element with bounds checking.
 
auto begin () -> iterator
 Returns an iterator to the beginning of the specified bucket.
 
auto begin () const -> const_iterator
 Returns an iterator to the beginning of the specified bucket.
 
auto end () -> iterator
 Returns an iterator to the end of the specified bucket.
 
auto end () const -> const_iterator
 Returns an iterator to the end of the specified bucket.
 
auto size () const -> size_type
 Returns the number of elements.
 
auto empty () const -> bool
 Checks whether the container is empty.
 
void insert (const std::string &key, const AstarteData &data)
 Insert elements.
 
auto erase (const std::string &key) -> size_type
 Erases elements.
 
void clear ()
 Clears the contents.
 
auto find (const std::string &key) -> iterator
 Finds element with specific key.
 
auto find (const std::string &key) const -> const_iterator
 Finds element with specific key.
 
auto get_raw_data () const -> const MapType &
 Return the raw data contained in this class instance.
 
auto operator== (const AstarteDatastreamObject &other) const -> bool
 Overloader for the comparison operator ==.
 
auto operator!= (const AstarteDatastreamObject &other) const -> bool
 Overloader for the comparison operator !=.
 

Detailed Description

Astarte object class, representing the Astarte object datastream data.

Member Typedef Documentation

◆ const_iterator

Helper type for the const iterator over the map of paths and Astarte datas.

◆ iterator

Helper type for the iterator over the map of paths and Astarte datas.

◆ MapType

using AstarteDeviceSdk::AstarteDatastreamObject::MapType = std::unordered_map<std::string, AstarteData>

Helper type for the map of paths and Astarte datas.

◆ size_type

Helper type for size type of the map of paths and Astarte datas.

◆ value_type

Helper type for value type of the map of paths and Astarte datas.

Constructor & Destructor Documentation

◆ AstarteDatastreamObject() [1/2]

AstarteDeviceSdk::AstarteDatastreamObject::AstarteDatastreamObject ( )

Constructor for the class. To instantiate an empty object.

◆ AstarteDatastreamObject() [2/2]

AstarteDeviceSdk::AstarteDatastreamObject::AstarteDatastreamObject ( std::initializer_list< value_type > init)

Constructor for the class. To instantiate a non-empty object.

Parameters
initThe initialize list to use as intial content.

Member Function Documentation

◆ at() [1/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::at ( const std::string & key) -> AstarteData &

Access specified element with bounds checking.

Soft wrapper for the equivalent method in the std::unordered_map.

Parameters
keyThe key to search for.
Returns
Reference to the value corresponding to the key.

◆ at() [2/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::at ( const std::string & key) const -> const AstarteData &

Access specified element with bounds checking.

Soft wrapper for the equivalent method in the std::unordered_map.

Parameters
keyThe key to search for.
Returns
Reference to the value corresponding to the key.

◆ begin() [1/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::begin ( ) -> iterator

Returns an iterator to the beginning of the specified bucket.

Soft wrapper for the equivalent method in the std::unordered_map.

Returns
Iterator pointing at the beginning of the map.

◆ begin() [2/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::begin ( ) const -> const_iterator

Returns an iterator to the beginning of the specified bucket.

Soft wrapper for the equivalent method in the std::unordered_map.

Returns
Iterator pointing at the beginning of the map.

◆ clear()

void AstarteDeviceSdk::AstarteDatastreamObject::clear ( )

Clears the contents.

Soft wrapper for the equivalent method in the std::unordered_map.

◆ empty()

auto AstarteDeviceSdk::AstarteDatastreamObject::empty ( ) const -> bool

Checks whether the container is empty.

Soft wrapper for the equivalent method in the std::unordered_map.

Returns
True if the map is empty, false otherwise.

◆ end() [1/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::end ( ) -> iterator

Returns an iterator to the end of the specified bucket.

Soft wrapper for the equivalent method in the std::unordered_map.

Returns
Iterator pointing at the end of the map.

◆ end() [2/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::end ( ) const -> const_iterator

Returns an iterator to the end of the specified bucket.

Soft wrapper for the equivalent method in the std::unordered_map.

Returns
Iterator pointing at the end of the map.

◆ erase()

auto AstarteDeviceSdk::AstarteDatastreamObject::erase ( const std::string & key) -> size_type

Erases elements.

Soft wrapper for the equivalent method in the std::unordered_map.

Parameters
keyKey to erase.
Returns
Number of elements removed (0 or 1).

◆ find() [1/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::find ( const std::string & key) -> iterator

Finds element with specific key.

Soft wrapper for the equivalent method in the std::unordered_map.

Parameters
keyKey to find.
Returns
An iterator to the requested element.

◆ find() [2/2]

auto AstarteDeviceSdk::AstarteDatastreamObject::find ( const std::string & key) const -> const_iterator

Finds element with specific key.

Soft wrapper for the equivalent method in the std::unordered_map.

Parameters
keyKey to find.
Returns
An iterator to the requested element.

◆ get_raw_data()

auto AstarteDeviceSdk::AstarteDatastreamObject::get_raw_data ( ) const -> const MapType &

Return the raw data contained in this class instance.

Returns
The raw data contained in this class instance.

◆ insert()

void AstarteDeviceSdk::AstarteDatastreamObject::insert ( const std::string & key,
const AstarteData & data )

Insert elements.

Soft wrapper for the equivalent method in the std::unordered_map.

Parameters
keyKey to insert.
dataValue to insert.

◆ operator!=()

auto AstarteDeviceSdk::AstarteDatastreamObject::operator!= ( const AstarteDatastreamObject & other) const -> bool
nodiscard

Overloader for the comparison operator !=.

Parameters
otherThe object to compare to.
Returns
True when different, false otherwise.

◆ operator==()

auto AstarteDeviceSdk::AstarteDatastreamObject::operator== ( const AstarteDatastreamObject & other) const -> bool
nodiscard

Overloader for the comparison operator ==.

Parameters
otherThe object to compare to.
Returns
True when equal, false otherwise.

◆ size()

auto AstarteDeviceSdk::AstarteDatastreamObject::size ( ) const -> size_type

Returns the number of elements.

Soft wrapper for the equivalent method in the std::unordered_map.

Returns
Number of elements in the map.

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