1 #ifndef OPENDDS_DCPS_UNIQUE_PTR_H 2 #define OPENDDS_DCPS_UNIQUE_PTR_H 4 #if !defined (ACE_LACKS_PRAGMA_ONCE) 14 # define OPENDDS_HAS_STD_UNIQUE_PTR 17 #ifdef OPENDDS_HAS_STD_UNIQUE_PTR 33 #ifdef OPENDDS_HAS_STD_UNIQUE_PTR 36 using std::unique_ptr;
39 using container_supported_unique_ptr = std::unique_ptr<T>;
42 struct EnableContainerSupportedUniquePtr {};
44 #else //HAS_STD_UNIQUE_PTR 51 void operator=(
const rv&);
63 template <
typename T,
typename Deleter = default_deleter<T> >
86 reset(other.release());
118 operator bool() const
130 return ptr_ < other.
ptr_;
140 template <
typename T>
141 typename T::rv_reference
move(T& p)
143 return static_cast<typename T::rv_reference
>(p);
147 template <
typename T,
typename Deleter>
153 template <
typename T>
167 template <
typename U>
173 template <
typename U>
191 template <
typename U>
219 template <
typename U>
256 operator bool()
const 263 return get() == rhs.
get();
268 return get() != rhs.
get();
273 return get() < rhs.
get();
297 template <
typename T>
303 template <
typename T>
311 template <
typename U>
314 template <
typename U>
324 if (new_count == 0) {
325 delete static_cast<T*
>(
this);
334 template <
typename T>
void swap(MessageBlock &lhs, MessageBlock &rhs)
unique_ptr & operator=(rv< unique_ptr > &other)
container_supported_unique_ptr(T *p)
void swap(container_supported_unique_ptr< T > &lhs, container_supported_unique_ptr< T > &rhs)
void swap(container_supported_unique_ptr &rhs)
#define OPENDDS_ASSERT(C)
container_supported_unique_ptr & operator=(const container_supported_unique_ptr< U > &b)
container_supported_unique_ptr & operator=(const container_supported_unique_ptr &b)
bool operator==(const container_supported_unique_ptr &rhs) const
container_supported_unique_ptr(unique_ptr< U > p)
container_supported_unique_ptr(const container_supported_unique_ptr &b)
unique_ptr< T >::rv_reference move(container_supported_unique_ptr< T > &ptr)
EnableContainerSupportedUniquePtr()
bool operator!=(const container_supported_unique_ptr &rhs) const
container_supported_unique_ptr(const container_supported_unique_ptr< U > &other)
unique_ptr(rv_reference other)
Atomic< long > ref_count_
~container_supported_unique_ptr()
container_supported_unique_ptr & operator=(unique_ptr< U > b)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
T * ptr_
The actual "unsmart" pointer to the T object.
container_supported_unique_ptr()
The Internal API and Implementation of OpenDDS.
friend unique_ptr< U >::rv_reference move(container_supported_unique_ptr< U > &ptr)
rv< unique_ptr > & rv_reference
bool operator<(const GUID_t &lhs, const GUID_t &rhs)
void operator()(T *ptr) const
bool operator<(const unique_ptr &other) const