5#ifndef ASTARTE_DEVICE_SDK_OWNERSHIP_H
6#define ASTARTE_DEVICE_SDK_OWNERSHIP_H
37 -> astarte_tl::expected<Ownership, Error> {
38 if (ownership ==
"device") {
41 if (ownership ==
"server") {
44 return astarte_tl::unexpected(
60 template <
typename ParseContext>
61 constexpr auto parse(ParseContext& ctx)
const {
73 template <
typename FormatContext>
79 astarte_fmt::format_to(out,
"device");
82 astarte_fmt::format_to(out,
"server");
99 out << astarte_fmt::format(
"{}", ownership);
Error indicating that the provided interface ownership is incorrect.
Definition errors.hpp:385
Error types and handling for the Astarte device library.
Umbrella namespace for the Astarte device library.
Definition data.hpp:29
Ownership
Possible Astarte ownership.
Definition ownership.hpp:23
@ kServer
Ownership is retained by the Astarte cloud server.
Definition ownership.hpp:27
@ kDevice
Ownership is retained by the device.
Definition ownership.hpp:25
auto ownership_from_str(const std::string &ownership) -> astarte_tl::expected< Ownership, Error >
Converts a string to an Ownership enum.
Definition ownership.hpp:36
Global namespace for all Astarte related functionality.
Definition data.hpp:29
auto operator<<(std::ostream &out, const astarte::device::Ownership ownership) -> std::ostream &
Stream insertion operator for Ownership.
Definition ownership.hpp:97