27 #ifndef SDBUS_CXX_TYPES_H_ 28 #define SDBUS_CXX_TYPES_H_ 33 #include <type_traits> 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>
139 constexpr Struct<std::decay_t<_Elements>...>
140 make_struct(_Elements&&... args)
142 typedef Struct<std::decay_t<_Elements>...> result_type;
143 return result_type(std::forward<_Elements>(args)...);
155 using std::string::string;
158 : std::string(std::move(path))
160 using std::string::operator=;
172 using std::string::string;
175 : std::string(std::move(path))
177 using std::string::operator=;
217 fd_ = ::dup(other.fd_);
223 *
this = std::move(other);
244 void reset(
int fd = -1)
251 *
this =
UnixFd{fd, adopt_fd};
Definition: TypeTraits.h:63
Definition: Message.h:230