68 template <
class Wrapped>
71 Wrapped wrapped{
nullptr};
80 static_assert(!std::is_array<Wrapped>::value &&
81 (std::is_class<Wrapped>::value ||
82 std::is_pointer<Wrapped>::value
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;
102 typename std::enable_if<std::is_constructible<Wrapped, T&&>::value &&
103 std::is_convertible<T&&, Wrapped>::value,
110 typename std::enable_if<std::is_constructible<Wrapped, T&&>::value &&
111 !std::is_convertible<T&&, Wrapped>::value,
125 typename std::enable_if<std::is_constructible<Wrapped, T&&>::value &&
126 std::is_convertible<T&&, Wrapped>::value &&
129 typename std::decay<T>::type>::value,
136 typename std::enable_if<std::is_constructible<Wrapped, T&&>::value &&
137 !std::is_convertible<T&&, Wrapped>::value &&
140 typename std::decay<T>::type>::value,
156 typename std::enable_if<std::is_convertible<T&&, Wrapped>::value,
bool>::type =
true>
165 typename std::enable_if<std::is_convertible<T&&, Wrapped>::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,
269 typename std::enable_if<std::is_pointer<T>::value ||
270 std::is_convertible<T, const ElementType*>::value,
278 template <
class T = Wrapped,
279 typename std::enable_if<std::is_pointer<T>::value ||
280 std::is_convertible<T, const ElementType*>::value,
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&>())))
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
Eigen::Vector3f Get(const Eigen::Vector3f &p1, const Eigen::Vector3f &p2, float t)
#define make_PropagateConst_cmp_function_objects(obj)
#define make_PropagateConst_cmp(op)
Wrapper for a pointer to propagate const to the pointed to value.
const ElementType * get() const
constexpr PropagateConst()=default
constexpr PropagateConst & operator=(T &&p)
friend constexpr wrapped & GetUnderlying(PropagateConst< wrapped > &pt) noexcept
const ElementType & operator*() const
PropagateConst & operator=(PropagateConst &&)=default
friend constexpr const wrapped & GetUnderlying(const PropagateConst< wrapped > &pt) noexcept
constexpr PropagateConst(Wrapped &p)
ElementType & operator*()
ElementType * operator->()
const ElementType * operator->() const
constexpr PropagateConst & operator=(PropagateConst< T > &&p)
constexpr PropagateConst(T &&p)
constexpr PropagateConst(PropagateConst &&)=default
typename std::remove_reference< decltype(*std::declval< Wrapped & >())>::type ElementType
constexpr void swap(PropagateConst &pt) noexcept(noexcept(std::swap(std::declval< Wrapped & >(), std::declval< Wrapped & >())))
constexpr PropagateConst(PropagateConst< T > &&p)
This file offers overloads of toIce() and fromIce() functions for STL container types.
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
ElementTypes::ElementType ElementType
bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
armarx::PropagateConst< T > argument_type
size_t operator()(const armarx::PropagateConst< T > &p) const noexcept(noexcept(hash< T >{}(GetUnderlying(p))))