NVIDIA DeepStream SDK API Reference

9.2 Release
sdk::common::AtomicUniquePtr< T > Class Template Reference

Detailed Description

template<class T>
class sdk::common::AtomicUniquePtr< T >

An owning pointer similar to std::unique_ptr but with methods for atomic operations.

Definition at line 21 of file includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

Public Member Functions

 AtomicUniquePtr () noexcept
 
 AtomicUniquePtr (std::unique_ptr< T > &&other) noexcept
 
 ~AtomicUniquePtr () noexcept
 
T & operator* () const noexcept
 
T * operator-> () const noexcept
 
T * Get () const noexcept
 
bool IsNull () const noexcept
 
bool SwapIfNull (std::unique_ptr< T > &owner) noexcept
 Atomically swap the pointer only if it's null. More...
 
void Swap (std::unique_ptr< T > &other) noexcept
 Atomically swap the pointer with another. More...
 
void Reset (T *ptr=nullptr) noexcept
 Set the pointer to a new value and delete the current value if non-null. More...
 
 AtomicUniquePtr () noexcept
 
 AtomicUniquePtr (std::unique_ptr< T > &&other) noexcept
 
 ~AtomicUniquePtr () noexcept
 
T & operator* () const noexcept
 
T * operator-> () const noexcept
 
T * Get () const noexcept
 
bool IsNull () const noexcept
 
bool SwapIfNull (std::unique_ptr< T > &owner) noexcept
 Atomically swap the pointer only if it's null. More...
 
void Swap (std::unique_ptr< T > &other) noexcept
 Atomically swap the pointer with another. More...
 
void Reset (T *ptr=nullptr) noexcept
 Set the pointer to a new value and delete the current value if non-null. More...
 

Constructor & Destructor Documentation

◆ AtomicUniquePtr() [1/4]

template<class T >
sdk::common::AtomicUniquePtr< T >::AtomicUniquePtr ( )
inlinenoexcept

◆ AtomicUniquePtr() [2/4]

template<class T >
sdk::common::AtomicUniquePtr< T >::AtomicUniquePtr ( std::unique_ptr< T > &&  other)
inlineexplicitnoexcept

◆ ~AtomicUniquePtr() [1/2]

◆ AtomicUniquePtr() [3/4]

template<class T >
sdk::common::AtomicUniquePtr< T >::AtomicUniquePtr ( )
inlinenoexcept

◆ AtomicUniquePtr() [4/4]

template<class T >
sdk::common::AtomicUniquePtr< T >::AtomicUniquePtr ( std::unique_ptr< T > &&  other)
inlineexplicitnoexcept

◆ ~AtomicUniquePtr() [2/2]

Member Function Documentation

◆ Get() [1/2]

template<class T >
T* sdk::common::AtomicUniquePtr< T >::Get ( ) const
inlinenoexcept

◆ Get() [2/2]

template<class T >
T* sdk::common::AtomicUniquePtr< T >::Get ( ) const
inlinenoexcept
Returns
the underly pointer managed.

Definition at line 37 of file 9.2/includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ IsNull() [1/2]

template<class T >
bool sdk::common::AtomicUniquePtr< T >::IsNull ( ) const
inlinenoexcept
Returns
true if the pointer is null

Definition at line 42 of file includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ IsNull() [2/2]

template<class T >
bool sdk::common::AtomicUniquePtr< T >::IsNull ( ) const
inlinenoexcept
Returns
true if the pointer is null

Definition at line 42 of file 9.2/includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ operator*() [1/2]

template<class T >
T& sdk::common::AtomicUniquePtr< T >::operator* ( ) const
inlinenoexcept

◆ operator*() [2/2]

template<class T >
T& sdk::common::AtomicUniquePtr< T >::operator* ( ) const
inlinenoexcept

◆ operator->() [1/2]

template<class T >
T* sdk::common::AtomicUniquePtr< T >::operator-> ( ) const
inlinenoexcept

◆ operator->() [2/2]

template<class T >
T* sdk::common::AtomicUniquePtr< T >::operator-> ( ) const
inlinenoexcept

◆ Reset() [1/2]

template<class T >
void sdk::common::AtomicUniquePtr< T >::Reset ( T *  ptr = nullptr)
inlinenoexcept

Set the pointer to a new value and delete the current value if non-null.

Parameters
ptrthe new pointer value to set

Definition at line 72 of file 9.2/includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ Reset() [2/2]

template<class T >
void sdk::common::AtomicUniquePtr< T >::Reset ( T *  ptr = nullptr)
inlinenoexcept

Set the pointer to a new value and delete the current value if non-null.

Parameters
ptrthe new pointer value to set

Definition at line 72 of file includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

Referenced by sdk::common::CircularBuffer< T >::Consume(), and sdk::common::AtomicUniquePtr< T >::~AtomicUniquePtr().

◆ Swap() [1/2]

template<class T >
void sdk::common::AtomicUniquePtr< T >::Swap ( std::unique_ptr< T > &  other)
inlinenoexcept

Atomically swap the pointer with another.

Parameters
otherThe pointer to swap with

Definition at line 66 of file 9.2/includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ Swap() [2/2]

template<class T >
void sdk::common::AtomicUniquePtr< T >::Swap ( std::unique_ptr< T > &  other)
inlinenoexcept

Atomically swap the pointer with another.

Parameters
otherThe pointer to swap with

Definition at line 66 of file includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ SwapIfNull() [1/2]

template<class T >
bool sdk::common::AtomicUniquePtr< T >::SwapIfNull ( std::unique_ptr< T > &  owner)
inlinenoexcept

Atomically swap the pointer only if it's null.

Parameters
ownerthe pointer to swap with
Returns
true if the swap was successful

Definition at line 49 of file includes/opentelemetry/sdk/common/atomic_unique_ptr.h.

◆ SwapIfNull() [2/2]

template<class T >
bool sdk::common::AtomicUniquePtr< T >::SwapIfNull ( std::unique_ptr< T > &  owner)
inlinenoexcept

Atomically swap the pointer only if it's null.

Parameters
ownerthe pointer to swap with
Returns
true if the swap was successful

Definition at line 49 of file 9.2/includes/opentelemetry/sdk/common/atomic_unique_ptr.h.


The documentation for this class was generated from the following file: