Astarte message class, represents a full message for/from Astarte.
More...
#include <msg.hpp>
Astarte message class, represents a full message for/from Astarte.
◆ AstarteMessage()
template<typename T>
| AstarteDeviceSdk::AstarteMessage::AstarteMessage |
( |
std::string_view | interface, |
|
|
std::string_view | path, |
|
|
T | data ) |
|
inline |
Constructor for the AstarteMessage class.
- Parameters
-
| interface | The interface for the message. |
| path | The path for the message. |
| data | The data for the message. |
◆ get_interface()
| auto AstarteDeviceSdk::AstarteMessage::get_interface |
( |
| ) |
const -> const std::string & |
|
nodiscard |
Get the interface of the message.
- Returns
- The interface.
◆ get_path()
| auto AstarteDeviceSdk::AstarteMessage::get_path |
( |
| ) |
const -> const std::string & |
|
nodiscard |
Get the path of the message.
- Returns
- The path.
◆ get_raw_data()
Return the raw data contained in this class instance.
- Returns
- The raw data contained in this class instance.
◆ into()
template<typename T>
| auto AstarteDeviceSdk::AstarteMessage::into |
( |
| ) |
const -> const T& |
|
inlinenodiscard |
Get the content of the message.
- Returns
- The value contained in the message.
◆ is_datastream()
| auto AstarteDeviceSdk::AstarteMessage::is_datastream |
( |
| ) |
const -> bool |
|
nodiscard |
Check if this message contains a datastream.
- Returns
- True if the message contains a datastream, false otherwise.
◆ is_individual()
| auto AstarteDeviceSdk::AstarteMessage::is_individual |
( |
| ) |
const -> bool |
|
nodiscard |
Check if this message contains individual data.
- Returns
- True if the message contains individual data, false otherwise.
◆ operator!=()
| auto AstarteDeviceSdk::AstarteMessage::operator!= |
( |
const AstarteMessage & | other | ) |
const -> bool |
|
nodiscard |
Overloader for the comparison operator !=.
- Parameters
-
| other | The object to compare to. |
- Returns
- True when different, false otherwise.
◆ operator==()
| auto AstarteDeviceSdk::AstarteMessage::operator== |
( |
const AstarteMessage & | other | ) |
const -> bool |
|
nodiscard |
Overloader for the comparison operator ==.
- Parameters
-
| other | The object to compare to. |
- Returns
- True when equal, false otherwise.
◆ try_into()
template<typename T>
| auto AstarteDeviceSdk::AstarteMessage::try_into |
( |
| ) |
const -> std::optional<T> |
|
inlinenodiscard |
Return the content of the message if it's of the correct type.
- Returns
- The value contained in the message or nullopt.
The documentation for this class was generated from the following file:
- /home/runner/work/astarte-device-sdk-cpp/astarte-device-sdk-cpp/astarte-device-sdk-cpp/include/astarte_device_sdk/msg.hpp