Bitcoin ABC  0.29.1
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)
 
template<typename U >
 RCUPtr (const RCUPtr< U > &src)
 Implicit converting constructor from RCUPtr to RCUPtr<T>, where U * is implicitely convertible to T *. More...
 
template<typename U >
RCUPtroperator= (const RCUPtr< U > &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 85 of file rcu.h.

Constructor & Destructor Documentation

◆ RCUPtr() [1/5]

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

Definition at line 89 of file rcu.h.

◆ RCUPtr() [2/5]

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

Definition at line 92 of file rcu.h.

Here is the caller graph for this function:

◆ ~RCUPtr()

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

Definition at line 94 of file rcu.h.

◆ RCUPtr() [3/5]

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

Copy semantic.

Definition at line 130 of file rcu.h.

◆ RCUPtr() [4/5]

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

Implicit converting constructor from RCUPtr to RCUPtr<T>, where U * is implicitely convertible to T *.

Definition at line 146 of file rcu.h.

◆ RCUPtr() [5/5]

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

Move semantic.

Definition at line 161 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 103 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 119 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 170 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 171 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 112 of file rcu.h.

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

◆ operator bool()

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

Definition at line 191 of file rcu.h.

◆ operator*() [1/2]

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

Definition at line 188 of file rcu.h.

◆ operator*() [2/2]

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

Definition at line 189 of file rcu.h.

◆ operator->() [1/2]

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

Operator overloading for convenience.

Definition at line 185 of file rcu.h.

◆ operator->() [2/2]

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

Definition at line 186 of file rcu.h.

◆ operator=() [1/3]

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

Definition at line 136 of file rcu.h.

◆ operator=() [2/3]

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

Definition at line 152 of file rcu.h.

◆ operator=() [3/3]

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

Definition at line 162 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 176 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 208 of file rcu.h.

◆ operator!= [2/2]

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

Definition at line 204 of file rcu.h.

◆ operator<<

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

ostream support.

Definition at line 215 of file rcu.h.

◆ operator== [1/2]

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

Definition at line 200 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 196 of file rcu.h.

Member Data Documentation

◆ ptr

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

Definition at line 86 of file rcu.h.


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