27#ifndef SDBUS_CXX_TYPES_H_
28#define SDBUS_CXX_TYPES_H_
58 template <
typename _ValueType>
59 Variant(
const _ValueType& value)
68 template <
typename _ValueType>
69 _ValueType get()
const
80 template <typename _ValueType, typename = std::enable_if_t<signature_of<_ValueType>::is_valid>>
81 operator _ValueType()
const
83 return get<_ValueType>();
86 template <
typename _Type>
87 bool containsValueOfType()
const
94 void serializeTo(
Message& msg)
const;
95 void deserializeFrom(
Message& msg);
96 std::string peekValueType()
const;
108 template <
typename... _ValueTypes>
110 :
public std::tuple<_ValueTypes...>
113 using std::tuple<_ValueTypes...>::tuple;
116#if !((defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__) && !(__GNUC__ > 7 || (__GNUC__ == 7 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 0)))))
119 explicit Struct(
const std::tuple<_ValueTypes...>& t)
120 : std::tuple<_ValueTypes...>(t)
125 template <std::
size_t _I>
128 return std::get<_I>(*
this);
131 template <std::
size_t _I>
132 const auto& get()
const
134 return std::get<_I>(*
this);
138 template<
typename... _Elements>
140 make_struct(_Elements&&... args)
143 return result_type(std::forward<_Elements>(args)...);
155 using std::string::string;
162 : std::string(std::move(path))
164 using std::string::operator=;
176 using std::string::string;
183 : std::string(std::move(path))
185 using std::string::operator=;
222 fd_ = ::dup(other.fd_);
228 *
this = std::move(other);
249 void reset(
int fd = -1)
256 *
this =
UnixFd{fd, adopt_fd};
Definition: Message.h:239
Definition: TypeTraits.h:82
Definition: TypeTraits.h:88