5#ifndef ASTARTE_DEVICE_SDK_MSG_H
6#define ASTARTE_DEVICE_SDK_MSG_H
20#include "astarte_device_sdk/property.hpp"
35 : interface_(interface), path_(path), data_(data) {}
46 [[nodiscard]] auto
get_path() const -> const std::
string&;
62 [[nodiscard]] auto
into() const -> const T& {
63 return std::get<T>(data_);
70 [[nodiscard]]
auto try_into() const -> std::optional<T> {
71 if (std::holds_alternative<T>(data_)) {
72 return std::get<T>(data_);
98 std::
string interface_;
Representing the Astarte individual datastream data.
Definition individual.hpp:18
Astarte object class, representing the Astarte object datastream data.
Definition object.hpp:22
auto get_raw_data() const -> const std::variant< AstarteDatastreamIndividual, AstarteDatastreamObject, AstartePropertyIndividual > &
Return the raw data contained in this class instance.
auto is_datastream() const -> bool
Check if this message contains a datastream.
auto into() const -> const T &
Get the content of the message.
Definition msg.hpp:62
auto is_individual() const -> bool
Check if this message contains individual data.
auto get_path() const -> const std::string &
Get the path of the message.
AstarteMessage(std::string_view interface, std::string_view path, T data)
Constructor for the AstarteMessage class.
Definition msg.hpp:34
auto get_interface() const -> const std::string &
Get the interface of the message.
auto try_into() const -> std::optional< T >
Return the content of the message if it's of the correct type.
Definition msg.hpp:70
Representing the Astarte individual datastream data.
Definition property.hpp:20
Astarte individual datastream class and its related methods.
Umbrella namespace for the Astarte device SDK.
Definition data.hpp:22
Astarte object class and its related methods.