29 template <
typename TYPE,
typename DELETER = deleter<TYPE>>
37 explicit ownerPtr(TYPE* p = std::nullptr_t{});
69 [[nodiscard]] std::string
className()
const override;
77 template <
typename T,
typename DEL,
typename... Args>
80 template <
typename T,
typename DEL,
typename... Args>
99 template <
typename T,
typename DEL = deleter<T>,
typename... Args>
118 template <
typename T,
typename DEL = deleter<T[]>,
typename... Args>
125 template<
typename TYPE,
typename DELETER>
131 template<
typename TYPE,
typename DELETER>
136 template<
typename TYPE,
typename DELETER>
145 other.addStrongRef();
149 template<
typename TYPE,
typename DELETER>
151 TYPE* p = this->
get();
156 template<
typename TYPE,
typename DELETER>
161 template<
typename TYPE,
typename DELETER>
166 template<
typename T,
typename DEL,
typename ... Args>
171 template<
typename T,
typename DEL,
typename ... Args>
176 owner_ptr[i] = T(std::forward<Args>(args)...);
Base class for reference-counted smart pointers.
static refCount< TYPE, DELETER > * newRefCount(TYPE *p=nullptr)
Create new reference counter.
Definition autoPtr.h:377
void removeStrongRef()
Decrement strong reference count.
Definition autoPtr.h:351
void addStrongRef()
Increment strong reference count.
Definition autoPtr.h:341
void setPtr(TYPE *p)
Replace managed pointer.
Definition autoPtr.h:333
void clean() noexcept
Cleanup resources when expired.
Definition autoPtr.h:367
autoPtr(TYPE *p)
Construct from raw pointer.
Definition autoPtr.h:328
refCount< TYPE, DELETER > * ref_count
Reference counter object.
Definition autoPtr.h:38
const TYPE * get() const
Get managed pointer const version.
Definition autoPtr.h:408
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:30
friend ownerPtr< T, DEL > makeOwnerPtrArray(u_integer size, Args &&... args)
Creates a new ownerPtr managing a dynamically allocated array.
Definition ownerPtr.h:172
~ownerPtr() override
Destructor releases owned resources.
Definition ownerPtr.h:162
friend ownerPtr< T, DEL > makeOwnerPtr(Args &&... args)
Creates a new ownerPtr managing a dynamically allocated object.
Definition ownerPtr.h:167
ownerPtr(TYPE *p=std::nullptr_t{})
Construct from raw pointer.
Definition ownerPtr.h:126
TYPE * unlock()
Release ownership of managed object.
Definition ownerPtr.h:150
ownerPtr(const ownerPtr &other)=delete
Copy construction prohibited.
ownerPtr & operator=(const ownerPtr &other)=delete
Copy assignment prohibited.
std::string className() const override
Get class name identifier.
Definition ownerPtr.h:157
Default deleters for resource management.
Main namespace for the project Original.
Definition algorithms.h:21
std::uint32_t u_integer
32-bit unsigned integer type for sizes/indexes
Definition config.h:17
ownerPtr< T, DEL > makeOwnerPtr(Args &&... args)
Creates a new ownerPtr managing a dynamically allocated object.
Definition ownerPtr.h:167
ownerPtr< T, DEL > makeOwnerPtrArray(u_integer size, Args &&... args)
Creates a new ownerPtr managing a dynamically allocated array.
Definition ownerPtr.h:172