STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions
stapl::runtime::ref_counted_wrapper< T > Class Template Reference

Wrapper over T to make it conformable with ref_counted. More...

Public Member Functions

template<typename... U>
 ref_counted_wrapper (U &&... u)
 
void add_ref (long count=1, std::memory_order order=std::memory_order_relaxed) noexcept
 Increases the reference count by count.
 
long remove_ref (long count=1, std::memory_order order=std::memory_order_relaxed) noexcept
 Decreases the reference count by count. More...
 
bool release (std::memory_order order=std::memory_order_relaxed) noexcept
 Decreases the reference count, destroying the object if it reached 0. More...
 
long use_count (std::memory_order order=std::memory_order_relaxed) const noexcept
 
bool unique (std::memory_order order=std::memory_order_relaxed) const noexcept
 

Detailed Description

template<typename T>
class stapl::runtime::ref_counted_wrapper< T >

Wrapper over T to make it conformable with ref_counted.

Member Function Documentation

◆ remove_ref()

long stapl::runtime::ref_counted< ref_counted_wrapper< T > , std::default_delete<ref_counted_wrapper< T > > >::remove_ref ( long  count = 1,
std::memory_order  order = std::memory_order_relaxed 
)
noexceptinherited

Decreases the reference count by count.

Returns
The new reference count.

◆ release()

bool stapl::runtime::ref_counted< ref_counted_wrapper< T > , std::default_delete<ref_counted_wrapper< T > > >::release ( std::memory_order  order = std::memory_order_relaxed)
noexceptinherited

Decreases the reference count, destroying the object if it reached 0.

Warning
If release() returns true, then the object has been destroyed.
Returns
true if the object was destroyed, otherwise false.

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