Go to the documentation of this file.
26 #include <type_traits>
68 template <
class Wrapped>
71 Wrapped wrapped{
nullptr};
85 std::is_object<
typename std::remove_pointer<Wrapped>::type>::
value,
86 "PropagateConst requires Wrapped to be a ptr type"
89 using ElementType =
typename std::remove_reference<decltype(*std::declval<Wrapped&>())>::type;
103 typename std::enable_if <
112 typename std::enable_if <
128 typename std::enable_if <
139 typename std::enable_if <
167 typename std::enable_if <
175 wrapped = std::forward<T>(p);
197 template<
class T>
static constexpr
ElementType* Get(
T* p)
201 template<
class T>
static constexpr
ElementType* Get(
T& p)
205 template<
class T>
static constexpr
const ElementType* Get(
const T* p)
209 template<
class T>
static constexpr
const ElementType* Get(
const T& p)
215 explicit constexpr
operator bool()
const
217 return static_cast<bool>(wrapped);
243 typename std::enable_if <
256 typename std::enable_if <
276 return GetUnderlying(pt) ==
nullptr;
282 return nullptr == GetUnderlying(pt);
288 return GetUnderlying(pt) !=
nullptr;
294 return nullptr != GetUnderlying(pt);
297 #define make_PropagateConst_cmp(op) \
298 template<class T0, typename T1> \
299 constexpr bool operator op(const PropagateConst<T0>& pt0,const PropagateConst<T1>& pt1) \
301 return GetUnderlying(pt0) op GetUnderlying(pt1); \
303 template<class Wrapped, typename T> \
304 constexpr bool operator op(const PropagateConst<Wrapped>& pt, const T& rhs) \
306 return GetUnderlying(pt) op rhs; \
308 template<class Wrapped, typename T> \
309 constexpr bool operator op(const T& lhs,const PropagateConst<Wrapped>& pt) \
311 return lhs op GetUnderlying(pt); \
321 #undef make_PropagateConst_cmp
324 constexpr
void swap(PropagateConst<T>& pt1, PropagateConst<T>& pt2) noexcept(noexcept(
swap(std::declval<T&>(), std::declval<T&>())))
329 template<
class T> constexpr
const T& GetUnderlying(
const PropagateConst<T>& pt) noexcept
333 template<
class T> constexpr
T& GetUnderlying(PropagateConst<T>& pt) noexcept
348 return hash<T> {}(GetUnderlying(p));
352 #define make_PropagateConst_cmp_function_objects(obj) \
354 struct obj<armarx::PropagateConst<T>> \
356 using first_argument_type = armarx::PropagateConst<T>; \
357 using second_argument_type = armarx::PropagateConst<T>; \
358 using result_type = bool; \
359 constexpr bool operator()(const first_argument_type& l, const second_argument_type& r) const \
361 return obj<T>{}(GetUnderlying(l), GetUnderlying(r)); \
372 #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< std::unique_ptr< armarx::control::ethercat::RequestQueue::QueueImpl > & >())>::type ElementType
#define make_PropagateConst_cmp(op)
constexpr PropagateConst(Wrapped &p)
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
size_t operator()(const armarx::PropagateConst< T > &p) const noexcept(noexcept(hash< T > {}(GetUnderlying(p))))
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.
Wrapper for a pointer to propagate const to the pointed to value.