|
| | ownerPtr (TYPE *p=std::nullptr_t{}) |
| | Construct from raw pointer.
|
| |
|
| ownerPtr (const ownerPtr &other)=delete |
| | Copy construction prohibited.
|
| |
|
ownerPtr & | operator= (const ownerPtr &other)=delete |
| | Copy assignment prohibited.
|
| |
| | ownerPtr (ownerPtr &&other) noexcept |
| | Move constructor.
|
| |
| ownerPtr & | operator= (ownerPtr &&other) noexcept |
| | Move assignment operator.
|
| |
| TYPE * | unlock () |
| | Release ownership of managed object.
|
| |
| std::string | className () const override |
| | Get class name identifier.
|
| |
|
| ~ownerPtr () override |
| | Destructor releases owned resources.
|
| |
| 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.
|
| |
| const TYPE * | get () const |
| | Get managed pointer const version.
|
| |
| TYPE * | get () |
| | Get managed pointer.
|
| |
| virtual const TYPE & | operator* () const |
| | Const dereference operator.
|
| |
| virtual const TYPE * | operator-> () const |
| | Const member access operator.
|
| |
| virtual const TYPE & | operator[] (u_integer index) const |
| | Const array access operator.
|
| |
| virtual TYPE & | operator* () |
| | Mutable dereference operator.
|
| |
| virtual TYPE * | operator-> () |
| | Mutable member access operator.
|
| |
| virtual TYPE & | operator[] (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.
|
| |
| std::string | toString (bool enter) const override |
| | String representation formatter.
|
| |
| u_integer | toHash () const noexcept override |
| | Computes the hash of the object.
|
| |
|
bool | equals (const autoPtr &other) const noexcept override |
| |
|
| ~autoPtr () override |
| | Destructor triggers reference cleanup.
|
| |
| | operator std::string () const |
| | Explicit conversion to std::string.
|
| |
| | operator const char * () const |
| | Explicit conversion to C-style string.
|
| |
| const char * | toCString (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 |
| |
| 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.
|
| |
| virtual bool | equals (const autoPtr< TYPE, DERIVED, DELETER > &other) const noexcept |
| | Compares two objects for equality.
|
| |
|
virtual | ~hashable ()=0 |
| | Virtual destructor.
|
| |
|
| template<typename TYPE > |
| static std::string | formatString (const TYPE &t) |
| | Universal value-to-string conversion.
|
| |
| template<typename TYPE > |
| static std::string | formatString (TYPE *const &ptr) |
| | Pointer-specific formatting.
|
| |
| template<typename TYPE > |
| static const char * | formatCString (const TYPE &t) |
| | C-string cache for temporary usage.
|
| |
| template<typename TYPE > |
| static std::string | formatEnum (const TYPE &t) |
| | Enum formatting utility.
|
| |
|
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 |
| |
| | autoPtr (TYPE *p) |
| | Construct from raw pointer.
|
| |
| void | setPtr (TYPE *p) |
| | Replace managed pointer.
|
| |
|
void | addStrongRef () |
| | Increment strong reference count.
|
| |
|
void | addWeakRef () |
| | Increment weak reference count.
|
| |
|
void | removeStrongRef () |
| | Decrement strong reference count.
|
| |
|
void | removeWeakRef () |
| | Decrement weak reference count.
|
| |
| void | destroyRefCnt () noexcept |
| | Destroy reference counter.
|
| |
|
void | clean () noexcept |
| | Cleanup resources when expired.
|
| |
| static refCount< TYPE, DELETER > * | newRefCount (TYPE *p=nullptr) |
| | Create new reference counter.
|
| |
|
refCount< TYPE, DELETER > * | ref_count |
| | Reference counter object.
|
| |
template<typename TYPE, typename DELETER = deleter<TYPE>>
class original::ownerPtr< TYPE, DELETER >
Unique ownership smart pointer with move semantics.
- Template Parameters
-
| TYPE | Managed object type |
| DELETER | Deletion policy type (default: deleter<TYPE>) |
Key features:
- Explicit ownership transfer through move operations
- Prohibited copy operations for ownership uniqueness
- RAII-compliant automatic resource management
- Factory functions for safe object creation