|
| copy_on_write_ptr (::lagrange::internal::shared_ptr< T > &&ptr=nullptr) |
| Construct a copy-on-write ptr from a shared-pointer.
|
|
| copy_on_write_ptr (copy_on_write_ptr &&)=default |
| Default move constructor.
|
|
copy_on_write_ptr & | operator= (copy_on_write_ptr &&)=default |
| Default move assignment operator.
|
|
template<typename Derived > |
| copy_on_write_ptr (copy_on_write_ptr< Derived > &&ptr) |
| Move-construct from a derived type.
|
|
| copy_on_write_ptr (const copy_on_write_ptr &)=default |
| Default copy constructor.
|
|
copy_on_write_ptr & | operator= (const copy_on_write_ptr &)=default |
| Default copy assignment operator.
|
|
| operator bool () const |
| Check if this copy-on-write ptr is nullptr.
|
|
const T * | read () const |
| Returns a const pointer to the data. Does not require ownership and will not lead to any copy.
|
|
template<typename Derived > |
const Derived * | static_read () const |
| Returns a const pointer to the data. Does not require ownership and will not lead to any copy.
|
|
template<typename Derived > |
Derived * | static_write () |
| Returns a writable pointer to the data. Will cause a copy if ownership is shared.
|
|
template<typename Derived > |
std::shared_ptr< Derived > | release_ptr () |
| Returns a writable smart pointer to the data. Will cause a copy if ownership is shared.
|
|
::lagrange::internal::weak_ptr< const T > | _get_weak_ptr () const |
| Return a weak pointer to the data. More...
|
|
::lagrange::internal::weak_ptr< T > | _get_weak_ptr () |
| Return a weak pointer to the data. More...
|
|
template<typename T>
class lagrange::copy_on_write_ptr< T >
A handle type with copy-on-write semantics.
Any copy of the handle will share data ownership, causing potential copies of the data on write access.
- Template Parameters
-