ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
original::refCntPtr< TYPE, DERIVED, DELETER > Class Template Reference

Base class for reference-counted pointers. More...

#include <refCntPtr.h>

Inheritance diagram for original::refCntPtr< TYPE, DERIVED, DELETER >:
Inheritance graph
Collaboration diagram for original::refCntPtr< TYPE, DERIVED, DELETER >:
Collaboration graph

Public Member Functions

template<typename O_DERIVED >
bool operator== (const refCntPtr< TYPE, O_DERIVED, DELETER > &other) const
 Equality comparison operator.
 
template<typename O_DERIVED >
bool operator!= (const refCntPtr< TYPE, O_DERIVED, DELETER > &other) const
 Inequality comparison operator.
 
std::string className () const override
 Get class identifier.
 
std::string toString (bool enter) const override
 Formatted string with reference info.
 
 ~refCntPtr () override=default
 Default destructor of refCntPtr.
 
- Public Member Functions inherited from original::autoPtr< TYPE, DERIVED, DELETER >
u_integer strongRefs () const
 Get strong reference count.
 
u_integer weakRefs () const
 Get weak reference count.
 
bool exist () const
 Check active ownership.
 
bool expired () const
 Check resource validity.
 
 operator bool () const
 Boolean conversion operator.
 
bool operator! () const
 Logical NOT operator.
 
const TYPEget () const
 Get managed pointer const version.
 
TYPEget ()
 Get managed pointer.
 
virtual const TYPEoperator* () const
 Const dereference operator.
 
virtual const TYPEoperator-> () const
 Const member access operator.
 
virtual const TYPEoperator[] (u_integer index) const
 Const array access operator.
 
virtual TYPEoperator* ()
 Mutable dereference operator.
 
virtual TYPEoperator-> ()
 Mutable member access operator.
 
virtual TYPEoperator[] (u_integer index)
 Mutable array access operator.
 
void swap (autoPtr &other) noexcept
 Swaps the reference counters between two autoPtr instances.
 
integer compareTo (const autoPtr &other) const override
 Compare reference counters.
 
u_integer toHash () const noexcept override
 Compute hash value for the pointer.
 
bool equals (const autoPtr &other) const noexcept override
 Equality comparison.
 
 ~autoPtr () override
 Destructor triggers reference cleanup.
 
- Public Member Functions inherited from original::printable
 operator std::string () const
 Explicit conversion to std::string.
 
 operator const char * () const
 Explicit conversion to C-style string.
 
const chartoCString (bool enter) const
 Direct C-string access with formatting control.
 
template<typename TYPE >
auto formatString (const TYPE &t) -> std::string
 
template<typename TYPE >
auto formatCString (const TYPE &t) -> const char *
 
template<typename TYPE >
auto formatEnum (const TYPE &t) -> std::string
 
template<typename TYPE >
auto formatString (TYPE *const &ptr) -> std::string
 
- Public Member Functions inherited from original::comparable< autoPtr< TYPE, DERIVED, DELETER > >
bool operator== (const autoPtr< TYPE, DERIVED, DELETER > &other) const
 Checks if the current object is equal to another.
 
bool operator!= (const autoPtr< TYPE, DERIVED, DELETER > &other) const
 Checks if the current object is not equal to another.
 
bool operator< (const autoPtr< TYPE, DERIVED, DELETER > &other) const
 Checks if the current object is less than another.
 
bool operator> (const autoPtr< TYPE, DERIVED, DELETER > &other) const
 Checks if the current object is greater than another.
 
bool operator<= (const autoPtr< TYPE, DERIVED, DELETER > &other) const
 Checks if the current object is less than or equal to another.
 
bool operator>= (const autoPtr< TYPE, DERIVED, DELETER > &other) const
 Checks if the current object is greater than or equal to another.
 
virtual ~comparable ()=default
 Virtual destructor for proper cleanup of derived objects.
 
- Public Member Functions inherited from original::hashable< autoPtr< TYPE, DERIVED, DELETER > >
virtual bool equals (const autoPtr< TYPE, DERIVED, DELETER > &other) const noexcept
 Compares two objects for equality.
 
virtual ~hashable ()=0
 Virtual destructor.
 

Protected Member Functions

 refCntPtr (TYPE *p=std::nullptr_t{})
 Construct from raw pointer.
 
- Protected Member Functions inherited from original::autoPtr< TYPE, DERIVED, DELETER >
 autoPtr (TYPE *p)
 Construct from raw pointer.
 
void addStrongRef () const
 Increment strong reference count.
 
void addWeakRef () const
 Increment weak reference count.
 
void removeStrongRef () const
 Decrement strong reference count.
 
void removeWeakRef () const
 Decrement weak reference count.
 
TYPEreleasePtr () noexcept
 Release ownership of the managed pointer.
 
void destroyRefCnt () noexcept
 Destroy reference counter.
 
void clean () noexcept
 Cleanup resources when expired.
 

Additional Inherited Members

- Static Public Member Functions inherited from original::printable
template<typename TYPE >
static std::string formatString (const TYPE &t)
 Universal value-to-string conversion with type-specific formatting.
 
template<Printable TYPE>
static std::string formatString (const TYPE &t)
 Specialization for types deriving from printable.
 
template<EnumType TYPE>
static std::string formatString (const TYPE &t)
 Specialization for enum types with type-safe formatting.
 
template<typename TYPE >
static std::string formatString (TYPE *const &ptr)
 Pointer-specific formatting with null safety.
 
template<typename TYPE >
static const charformatCString (const TYPE &t)
 C-string cache for temporary usage with static storage.
 
template<typename TYPE >
static std::string formatEnum (const TYPE &t)
 Enum formatting utility with underlying value extraction.
 
template<>
auto formatString (const char &t) -> std::string
 
template<>
auto formatString (const bool &t) -> std::string
 
template<>
auto formatString (const char *const &ptr) -> std::string
 
- Static Protected Member Functions inherited from original::autoPtr< TYPE, DERIVED, DELETER >
static refCount< TYPE, DELETER > * newRefCount (TYPE *p=nullptr)
 Create new reference counter.
 
- Protected Attributes inherited from original::autoPtr< TYPE, DERIVED, DELETER >
atomic< refCountBase * > ref_count
 Reference counter object.
 
TYPEalias_ptr
 Aliased pointer for type casting scenarios.
 

Detailed Description

template<typename TYPE, typename DERIVED, typename DELETER>
class original::refCntPtr< TYPE, DERIVED, DELETER >

Base class for reference-counted pointers.

Template Parameters
TYPEManaged object type
DERIVEDCRTP pattern parameter
DELETERCustom deletion policy type

Provides shared infrastructure for:

Constructor & Destructor Documentation

◆ refCntPtr()

original::refCntPtr< TYPE, DERIVED, DELETER >::refCntPtr ( TYPE p = std::nullptr_t{})
explicitprotected

Construct from raw pointer.

Parameters
pPointer to manage
Note
Initializes reference counting system

Member Function Documentation

◆ className()

std::string original::refCntPtr< TYPE, DERIVED, DELETER >::className ( ) const
overridevirtual

◆ operator!=()

Inequality comparison operator.

Template Parameters
O_DERIVEDOther derived class type (strongPtr/weakPtr)
Parameters
otherReference-counted pointer to compare with
Returns
bool True if pointers use different reference counters

◆ operator==()

Equality comparison operator.

Template Parameters
O_DERIVEDOther derived class type (strongPtr/weakPtr)
Parameters
otherReference-counted pointer to compare with
Returns
bool True if both pointers share the same reference counter

◆ toString()

std::string original::refCntPtr< TYPE, DERIVED, DELETER >::toString ( bool  enter) const
overridevirtual

Formatted string with reference info.

Parameters
enterAdd newline if true
Returns
Contains pointer value and ref counts

Reimplemented from original::autoPtr< TYPE, DERIVED, DELETER >.


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