Generic allocator interfaces that can be injected into routines that need dynamic memory.
These include Allocator, as well as the Layout type that is passed to it and the managed smart pointer types, such as UniquePtr, that can be returned from it.
Classes | |
| class | pw::SharedPtr< T > |
| class | pw::Allocator |
| class | pw::allocator::Layout |
| class | pw::MaybeSharedPtr< T > |
| class | pw::allocator::Pool |
| class | pw::WeakPtr< T > |
| class | pw::UniquePtr< T > |
Functions | |
| bool | pw::allocator::operator== (const Layout &lhs, const Layout &rhs) |
| bool | pw::allocator::operator!= (const Layout &lhs, const Layout &rhs) |
| template<typename To , typename From > | |
| constexpr MaybeSharedPtr< To > | pw::static_pointer_cast (const MaybeSharedPtr< From > &p) noexcept |
| template<typename To , typename From > | |
| constexpr MaybeSharedPtr< To > | pw::const_pointer_cast (const MaybeSharedPtr< From > &p) noexcept |
| template<typename T > | |
| constexpr MaybeSharedPtr< T > | pw::Unowned (T &object) noexcept |
Constructs an unowned MaybeSharedPtr referencing an lvalue object. | |
| template<typename T > | |
| MaybeSharedPtr< T > | pw::Unowned (const T &&)=delete |
Disallows constructing an unowned MaybeSharedPtr from a temporary. | |
| template<typename To , typename From > | |
| constexpr SharedPtr< To > | pw::static_pointer_cast (const SharedPtr< From > &p) noexcept |
| template<typename To , typename From > | |
| constexpr SharedPtr< To > | pw::const_pointer_cast (const SharedPtr< From > &p) noexcept |
| template<typename U , typename > | |
| WeakPtr< T > & | pw::WeakPtr< T >::operator= (const WeakPtr< U > &other) noexcept |
| template<typename U , typename > | |
| WeakPtr< T > & | pw::WeakPtr< T >::operator= (const SharedPtr< U > &other) noexcept |
| template<typename U , typename > | |
| WeakPtr< T > & | pw::WeakPtr< T >::operator= (WeakPtr< U > &&other) noexcept |
| void | pw::WeakPtr< T >::reset () noexcept |
| SharedPtr< T > | pw::WeakPtr< T >::Lock () const noexcept |
|
constexprnoexcept |
Creates a new SharedPtr by const casting the given shared pointer.
For an arbitrary type A, a shared pointer to A can be automatically converted to one of type const A. This function can perform the reverse operation.
|
noexcept |
|
noexcept |
Resets this object to an empty state.
If this is the last shared or weak pointer associated with the control block, it is deallocated.
|
constexprnoexcept |
Creates a new SharedPtr by static casting the given shared pointer.
If an arbitrary type A derives from another type B, a shared pointer to A can be automatically upcast to one of type B. This function can perform the reverse operation and allows specifying only the element type.