EPAM B2BITS C++ MOEX/Spectra MarketData handler  1.24.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
B2bits::ReferenceCounter< Derived, CtrType > Class Template Reference

#include <b2bits/core/ReferenceCounter.h>

Public Member Functions

 ReferenceCounter () noexcept
 
 ReferenceCounter (ReferenceCounter const &) noexcept
 
ReferenceCounteroperator= (ReferenceCounter const &) noexcept
 
void addRef () const noexcept
 
void release () const noexcept
 
u32 useCount () const noexcept
 
RefCounterPtr< Derived > shared_from_this ()
 

Detailed Description

template<class Derived, class CtrType = std::atomic<u32>>
class B2bits::ReferenceCounter< Derived, CtrType >

A generic reference counter.

Constructor & Destructor Documentation

template<class Derived, class CtrType = std::atomic<u32>>
B2bits::ReferenceCounter< Derived, CtrType >::ReferenceCounter ( )
inlinenoexcept
template<class Derived, class CtrType = std::atomic<u32>>
B2bits::ReferenceCounter< Derived, CtrType >::ReferenceCounter ( ReferenceCounter< Derived, CtrType > const &  )
inlinenoexcept

Member Function Documentation

template<class Derived, class CtrType = std::atomic<u32>>
void B2bits::ReferenceCounter< Derived, CtrType >::addRef ( ) const
inlinenoexcept

Increments reference counter.

template<class Derived, class CtrType = std::atomic<u32>>
ReferenceCounter& B2bits::ReferenceCounter< Derived, CtrType >::operator= ( ReferenceCounter< Derived, CtrType > const &  )
inlinenoexcept
template<class Derived, class CtrType = std::atomic<u32>>
void B2bits::ReferenceCounter< Derived, CtrType >::release ( ) const
inlinenoexcept

Decrements reference counter. If it becomes equal to 0 then calls destructor.

template<class Derived, class CtrType = std::atomic<u32>>
RefCounterPtr<Derived> B2bits::ReferenceCounter< Derived, CtrType >::shared_from_this ( )
inline

Returns intrusive ptr from this

template<class Derived, class CtrType = std::atomic<u32>>
u32 B2bits::ReferenceCounter< Derived, CtrType >::useCount ( ) const
inlinenoexcept

Returns the current value of the reference counter.