File include/brisk/core/RC.hpp
¶
RC
typedef¶
template <typename T> RC = std::shared_ptr<T>
Alias for a shared pointer type using std::shared_ptr.
Template param T
The type of object managed by the shared pointer.
RC = std::shared_ptr<T>
Alias for a shared pointer type using std::shared_ptr.
Template param T
The type of object managed by the shared pointer.
WeakRC
typedef¶
template <typename T> WeakRC = std::weak_ptr<T>
Alias for a weak pointer type using std::weak_ptr.
Template param T
The type of object managed by the weak pointer.
WeakRC = std::weak_ptr<T>
Alias for a weak pointer type using std::weak_ptr.
Template param T
The type of object managed by the weak pointer.
RCNew
class (Internal::RCNew
)¶
RCNew
Utility for creating a shared pointer (RC) from a raw pointer.
The operator *
is overloaded to construct an RC
object from a raw pointer.
Details This is used with the rcnew
macro to allocate objects
and automatically wrap them in an RC
(std::shared_ptr).
rcNew
variable (Internal::rcNew
)¶
constexpr inline RCNew rcNew
Instance of RCNew used for creating reference-counted pointers.
Note (UNKNOWN ID: ('ref', 'RCNew'))
notManaged
function¶
template <typename T>
std::shared_ptr<T> notManaged(T *pointer)
Wraps a raw pointer in a shared pointer (RC
) without taking ownership.
Template param T
The type of the object being pointed to.
Param pointer
A raw pointer to the object. The pointer is not managed or deleted.
Returns A shared pointer (RC
) that does not manage the lifetime of the object.
InplacePtr
class¶
template <typename T> InplacePtr
A smart pointer-like structure that holds an object in-place.
Details This class provides pointer-like semantics while storing the object
directly within the structure. It can be implicitly converted to a shared pointer
(RC
) without managing the memory of the contained object.
Template param T
The type of object stored in the structure.
value
variable (InplacePtr::value
)¶
T value
The object stored in-place.
InplacePtr<T>
function (InplacePtr::InplacePtr<T>
)¶
template <typename... Args>
explicit InplacePtr(Args &&...args) : value
Constructs the object in-place with forwarded arguments.
Template param Args
The types of arguments used for constructing the object.
Param args
The arguments to construct the object.
operator->
function (InplacePtr::operator->
)¶
constexpr const T *operator->() const noexcept
Const dereference operator to access the stored object.
Returns A const pointer to the stored object.
operator*
function (InplacePtr::operator*
)¶
constexpr const T &operator*() const noexcept
Const dereference operator to access the stored object.
Returns A const reference to the stored object.
operator->
function (InplacePtr::operator->
)¶
constexpr T *operator->() noexcept
Dereference operator to access the stored object.
Returns A pointer to the stored object.
operator*
function (InplacePtr::operator*
)¶
constexpr T &operator*() noexcept
Dereference operator to access the stored object.
Returns A reference to the stored object.
operator shared_ptr<const type-parameter-0-0>
function (InplacePtr::operator shared_ptr<const type-parameter-0-0>
)¶
operator RC<const T>() const noexcept
Implicit conversion to a const shared pointer (RC<const T\>
).
Returns A shared pointer (RC<const T\>
) that does not manage the object.
operator shared_ptr<const type-parameter-1-0>
function (InplacePtr::operator shared_ptr<const type-parameter-1-0>
)¶
template <typename U>
operator RC<const U>() const noexcept
requires std::is_convertible_v<const T *, const U *>
Implicit conversion to a const shared pointer of a convertible type.
Template param U
The target type to convert to (must be convertible from T).
Returns A shared pointer (RC<const U\>
) that does not manage the object.
operator shared_ptr<type-parameter-0-0>
function (InplacePtr::operator shared_ptr<type-parameter-0-0>
)¶
operator RC<T>() noexcept
Implicit conversion to a shared pointer (RC<T\>
).
Returns A shared pointer (RC<T\>
) that does not manage the object.
operator shared_ptr<type-parameter-1-0>
function (InplacePtr::operator shared_ptr<type-parameter-1-0>
)¶
template <typename U>
operator RC<U>() noexcept
requires std::is_convertible_v<T *, U *>
Implicit conversion to a shared pointer of a convertible type.
Template param U
The target type to convert to (must be convertible from T).
Returns A shared pointer (RC<U\>
) that does not manage the object.
Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/