CsPointer  1.0.1
CsPointer::CsIntrusiveBase Class Reference

Implements reference count functions for CsIntrusivePointer. More...

Public Member Functions

virtual ~CsIntrusiveBase () = default
 

Detailed Description

The CsIntrusiveBase class implements the reference count functions for the CsIntrusivePointer class. This class has a virtual destructor and three private methods. The following methods will be called from the CsIntrusiveDefaultPolicy class and application code will not directly call these methods.

  • cs_inc_ref_count()
  • cs_dec_ref_count()
  • cs_get_ref_count()

Since the abstraction of an intrusive pointer is to store the reference count in the object itself, your base class will normally inherit from CsIntrusiveBase.

class BaseObject : public CsPointer::CsIntrusiveBase

Copy and Move Semantics

This class is not copyable or movable, therefore BaseObject or any class which inherits from it will not be copyable or movable. The CsIntrusiveBase_CM class is an alternate option and provides deep copy and move semantics.

CsIntrusivePointer is copyable and movable no matter which base class is used.

Additional Information

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

Constructor & Destructor Documentation

CsIntrusiveBase::~CsIntrusiveBase ( )
virtualdefault

Virtual destructor which does nothing.