CsPointer  1.0.1
CsPointer::CsIntrusiveDefaultPolicy Class Reference

Default implementation for incrementing or decrementing the reference count for CsIntrusivePointer. More...

Static Public Member Functions

template<typename T >
static void inc_ref_count (const T *ptr) noexcept
 
template<typename T >
static void dec_ref_count (const T *ptr, CsIntrusiveAction action=CsIntrusiveAction::Normal)
 
template<typename T >
static std::size_t get_ref_count (const T *ptr) noexcept
 

Detailed Description

The second template parameter for CsIntrusivePointer is the Policy. The argument for Policy is defaulted to CsIntrusiveDefaultPolicy. Pass a custom policy class if your application needs to redefine the implementation for incrementing or decrementing the reference count.

Additional Information

Refer to the CsIntrusivePointer documentation for information about when a custom policy class may be required.

Member Function Documentation

template<typename T >
static void CsIntrusiveDefaultPolicy::dec_ref_count ( const T *  ptr,
CsIntrusiveAction  action = CsIntrusiveAction::Normal 
)
inlinestatic

Calls dec_ref_count() in the CsIntrusiveBase object as defined by ptr. The enum value action is passed and is used to determine what action should be taken if the reference count becomes zero.

See also
CsIntrusivePointer::CsIntrusiveAction
template<typename T >
static std::size_t CsIntrusiveDefaultPolicy::get_ref_count ( const T *  ptr)
inlinestaticnoexcept

Calls get_ref_count() in the CsIntrusiveBase object as defined by ptr and returns the reference count.

template<typename T >
static void CsIntrusiveDefaultPolicy::inc_ref_count ( const T *  ptr)
inlinestaticnoexcept

Calls inc_ref_count() in the CsIntrusiveBase object as defined by ptr.