Go to the documentation of this file.
26 #include <type_traits>
68 template <
class Wrapped>
71 Wrapped wrapped{
nullptr};
84 std::is_object<
typename std::remove_pointer<Wrapped>::type>::
86 "PropagateConst requires Wrapped to be a ptr type");
89 typename std::remove_reference<decltype(*std::declval<Wrapped&>())>::type;
129 typename std::decay<T>::type>
::value,
140 typename std::decay<T>::type>
::value,
168 typename std::decay<T>::type>
::value,
173 wrapped = std::forward<T>(p);
180 std::declval<Wrapped&>())))
233 operator bool()
const
235 return static_cast<bool>(wrapped);
268 template <
class T = Wrapped,
278 template <
class T = Wrapped,
290 template <
class wrapped>
292 template <
class wrapped>
300 return GetUnderlying(pt) ==
nullptr;
307 return nullptr == GetUnderlying(pt);
314 return GetUnderlying(pt) !=
nullptr;
321 return nullptr != GetUnderlying(pt);
324 #define make_PropagateConst_cmp(op) \
325 template <class T0, typename T1> \
326 constexpr bool operator op(const PropagateConst<T0>& pt0, const PropagateConst<T1>& pt1) \
328 return GetUnderlying(pt0) op GetUnderlying(pt1); \
330 template <class Wrapped, typename T> \
331 constexpr bool operator op(const PropagateConst<Wrapped>& pt, const T& rhs) \
333 return GetUnderlying(pt) op rhs; \
335 template <class Wrapped, typename T> \
336 constexpr bool operator op(const T& lhs, const PropagateConst<Wrapped>& pt) \
338 return lhs op GetUnderlying(pt); \
344 #undef make_PropagateConst_cmp
347 constexpr
void swap(PropagateConst<T>& pt1,
348 PropagateConst<T>& pt2) noexcept(noexcept(
swap(std::declval<T&>(),
349 std::declval<T&>())))
356 GetUnderlying(
const PropagateConst<T>& pt) noexcept
363 GetUnderlying(PropagateConst<T>& pt) noexcept
379 noexcept(noexcept(hash<T>{}(GetUnderlying(p))))
381 return hash<T>{}(GetUnderlying(p));
385 #define make_PropagateConst_cmp_function_objects(obj) \
387 struct obj<armarx::PropagateConst<T>> \
389 using first_argument_type = armarx::PropagateConst<T>; \
390 using second_argument_type = armarx::PropagateConst<T>; \
391 using result_type = bool; \
393 operator()(const first_argument_type& l, const second_argument_type& r) const \
395 return obj<T>{}(GetUnderlying(l), GetUnderlying(r)); \
406 #undef make_PropagateConst_cmp_function_objects
constexpr PropagateConst & operator=(T &&p)
bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
const ElementType * get() const
constexpr const friend wrapped & GetUnderlying(const PropagateConst< wrapped > &pt) noexcept
constexpr PropagateConst & operator=(PropagateConst< T > &&p)
const ElementType & operator*() const
constexpr PropagateConst(PropagateConst< T > &&p)
void swap(SubscriptionHandle &first, SubscriptionHandle &second)
constexpr PropagateConst(T &&p)
std::shared_ptr< Value > value()
make_PropagateConst_cmp_function_objects(equal_to)
typename std::remove_reference< decltype(*std::declval< Wrapped & >())>::type ElementType
#define make_PropagateConst_cmp(op)
constexpr PropagateConst(Wrapped &p)
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
ElementType * operator->()
constexpr void swap(PropagateConst &pt) noexcept(noexcept(std::swap(std::declval< Wrapped & >(), std::declval< Wrapped & >())))
ElementType & operator*()
const ElementType * operator->() const
constexpr PropagateConst()=default
PropagateConst & operator=(PropagateConst &&)=default
This file offers overloads of toIce() and fromIce() functions for STL container types.
size_t operator()(const armarx::PropagateConst< T > &p) const noexcept(noexcept(hash< T >{}(GetUnderlying(p))))
Wrapper for a pointer to propagate const to the pointed to value.