Bitcoin ABC  0.24.7
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
RCUPtr< T > Class Template Reference

#include <rcu.h>

Public Member Functions

 RCUPtr ()
 
 ~RCUPtr ()
 
 RCUPtr (const RCUPtr &src)
 Copy semantic. More...
 
RCUPtroperator= (const RCUPtr &rhs)
 
 RCUPtr (RCUPtr &&src)
 Move semantic. More...
 
RCUPtroperator= (RCUPtr &&rhs)
 
T * get ()
 Get allows to access the undelying pointer. More...
 
const T * get () const
 
T * release ()
 Release transfers ownership of the pointer from RCUPtr to the caller. More...
 
T * operator-> ()
 Operator overloading for convenience. More...
 
const T * operator-> () const
 
T & operator* ()
 
const T & operator* () const
 
 operator bool () const
 

Static Public Member Functions

static RCUPtr acquire (T *&ptrIn)
 Acquire ownership of some pointer. More...
 
template<typename... Args>
static RCUPtr make (Args &&... args)
 Construct a new object that is owned by the pointer. More...
 
static RCUPtr copy (T *ptr)
 Construct a new RCUPtr without transferring owership. More...
 

Private Member Functions

 RCUPtr (T *ptrIn)
 

Private Attributes

T * ptr
 

Friends

bool operator== (const RCUPtr &lhs, const T *rhs)
 Equality checks. More...
 
bool operator== (const RCUPtr &lhs, const RCUPtr &rhs)
 
bool operator!= (const RCUPtr &lhs, const T *rhs)
 
bool operator!= (const RCUPtr &lhs, const RCUPtr &rhs)
 
std::ostream & operator<< (std::ostream &stream, const RCUPtr &rhs)
 ostream support. More...
 

Detailed Description

template<typename T>
class RCUPtr< T >

Definition at line 79 of file rcu.h.

Constructor & Destructor Documentation

◆ RCUPtr() [1/4]

template<typename T >
RCUPtr< T >::RCUPtr ( T *  ptrIn)
inlineexplicitprivate

Definition at line 83 of file rcu.h.

◆ RCUPtr() [2/4]

template<typename T >
RCUPtr< T >::RCUPtr ( )
inline

Definition at line 86 of file rcu.h.

Here is the caller graph for this function:

◆ ~RCUPtr()

template<typename T >
RCUPtr< T >::~RCUPtr ( )
inline

Definition at line 88 of file rcu.h.

◆ RCUPtr() [3/4]

template<typename T >
RCUPtr< T >::RCUPtr ( const RCUPtr< T > &  src)
inline

Copy semantic.

Definition at line 124 of file rcu.h.

◆ RCUPtr() [4/4]

template<typename T >
RCUPtr< T >::RCUPtr ( RCUPtr< T > &&  src)
inline

Move semantic.

Definition at line 139 of file rcu.h.

Member Function Documentation

◆ acquire()

template<typename T >
static RCUPtr RCUPtr< T >::acquire ( T *&  ptrIn)
inlinestatic

Acquire ownership of some pointer.

Definition at line 97 of file rcu.h.

Here is the caller graph for this function:

◆ copy()

template<typename T >
static RCUPtr RCUPtr< T >::copy ( T *  ptr)
inlinestatic

Construct a new RCUPtr without transferring owership.

Definition at line 113 of file rcu.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [1/2]

template<typename T >
T* RCUPtr< T >::get ( )
inline

Get allows to access the undelying pointer.

RCUPtr keeps ownership.

Definition at line 148 of file rcu.h.

Here is the caller graph for this function:

◆ get() [2/2]

template<typename T >
const T* RCUPtr< T >::get ( ) const
inline

Definition at line 149 of file rcu.h.

◆ make()

template<typename T >
template<typename... Args>
static RCUPtr RCUPtr< T >::make ( Args &&...  args)
inlinestatic

Construct a new object that is owned by the pointer.

Definition at line 106 of file rcu.h.

Here is the call graph for this function:

◆ operator bool()

template<typename T >
RCUPtr< T >::operator bool ( ) const
inlineexplicit

Definition at line 169 of file rcu.h.

◆ operator*() [1/2]

template<typename T >
T& RCUPtr< T >::operator* ( )
inline

Definition at line 166 of file rcu.h.

◆ operator*() [2/2]

template<typename T >
const T& RCUPtr< T >::operator* ( ) const
inline

Definition at line 167 of file rcu.h.

◆ operator->() [1/2]

template<typename T >
T* RCUPtr< T >::operator-> ( )
inline

Operator overloading for convenience.

Definition at line 163 of file rcu.h.

◆ operator->() [2/2]

template<typename T >
const T* RCUPtr< T >::operator-> ( ) const
inline

Definition at line 164 of file rcu.h.

◆ operator=() [1/2]

template<typename T >
RCUPtr& RCUPtr< T >::operator= ( const RCUPtr< T > &  rhs)
inline

Definition at line 130 of file rcu.h.

◆ operator=() [2/2]

template<typename T >
RCUPtr& RCUPtr< T >::operator= ( RCUPtr< T > &&  rhs)
inline

Definition at line 140 of file rcu.h.

◆ release()

template<typename T >
T* RCUPtr< T >::release ( )
inline

Release transfers ownership of the pointer from RCUPtr to the caller.

Definition at line 154 of file rcu.h.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator!= [1/2]

template<typename T >
bool operator!= ( const RCUPtr< T > &  lhs,
const RCUPtr< T > &  rhs 
)
friend

Definition at line 186 of file rcu.h.

◆ operator!= [2/2]

template<typename T >
bool operator!= ( const RCUPtr< T > &  lhs,
const T *  rhs 
)
friend

Definition at line 182 of file rcu.h.

◆ operator<<

template<typename T >
std::ostream& operator<< ( std::ostream &  stream,
const RCUPtr< T > &  rhs 
)
friend

ostream support.

Definition at line 193 of file rcu.h.

◆ operator== [1/2]

template<typename T >
bool operator== ( const RCUPtr< T > &  lhs,
const RCUPtr< T > &  rhs 
)
friend

Definition at line 178 of file rcu.h.

◆ operator== [2/2]

template<typename T >
bool operator== ( const RCUPtr< T > &  lhs,
const T *  rhs 
)
friend

Equality checks.

Definition at line 174 of file rcu.h.

Member Data Documentation

◆ ptr

template<typename T >
T* RCUPtr< T >::ptr
private

Definition at line 80 of file rcu.h.


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