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;
112 template <
typename... _ValueTypes>
114 :
public std::tuple<_ValueTypes...>
117 using std::tuple<_ValueTypes...>::tuple;
120 #if !((defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__) && !(__GNUC__ > 7 || (__GNUC__ == 7 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 0))))) 123 explicit Struct(
const std::tuple<_ValueTypes...>& t)
124 :
std::tuple<_ValueTypes...>(t)
129 template <std::
size_t _I>
132 return std::get<_I>(*this);
135 template <std::
size_t _I>
136 const auto&
get()
const 138 return std::get<_I>(*this);
142 template <
typename... _Elements>
143 Struct(_Elements...) -> Struct<_Elements...>;
145 template<
typename... _Elements>
146 constexpr Struct<std::decay_t<_Elements>...>
147 make_struct(_Elements&&... args)
149 typedef Struct<std::decay_t<_Elements>...> result_type;
150 return result_type(std::forward<_Elements>(args)...);
162 using std::string::string;
169 : std::string(std::move(path))
171 using std::string::operator=;
183 using std::string::string;
190 : std::string(std::move(path))
192 using std::string::operator=;
229 fd_ = ::dup(other.fd_);
235 *
this = std::move(other);
256 void reset(
int fd = -1)
263 *
this =
UnixFd{fd, adopt_fd};
290 template <
size_t _I,
typename... _ValueTypes>
291 struct std::tuple_element<_I,
sdbus::Struct<_ValueTypes...>>
292 : std::tuple_element<_I, std::tuple<_ValueTypes...>>
295 template <
typename... _ValueTypes>
296 struct std::tuple_size<
sdbus::Struct<_ValueTypes...>>
297 : std::tuple_size<std::tuple<_ValueTypes...>>
Definition: TypeTraits.h:87
Definition: TypeTraits.h:99
Definition: AdaptorInterfaces.h:36
Definition: Message.h:299