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;
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>
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=;
212 : fd_(checkedDup(fd))
233 fd_ = checkedDup(other.fd_);
239 *
this = std::move(other);
249 fd_ = std::exchange(other.fd_, -1);
263 void reset(
int fd = -1)
270 *
this =
UnixFd{fd, adopt_fd};
275 return std::exchange(fd_, -1);
289 static int checkedDup(
int fd);
296template <
size_t _I,
typename... _ValueTypes>
297struct std::tuple_element<_I, sdbus::Struct<_ValueTypes...>>
298 : std::tuple_element<_I, std::tuple<_ValueTypes...>>
301template <
typename... _ValueTypes>
302struct std::tuple_size<sdbus::Struct<_ValueTypes...>>
303 : std::tuple_size<std::tuple<_ValueTypes...>>
Definition TypeTraits.h:87
Definition TypeTraits.h:103