LibreOffice Module o3tl (master) 1
|
#include <cow_wrapper.hxx>
Classes | |
struct | impl_t |
shared value object - gets cloned before cow_wrapper hands out a non-const reference to it More... | |
Public Types | |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef MTPolicy | mt_policy |
Public Member Functions | |
cow_wrapper () | |
Default-construct wrapped type instance. More... | |
cow_wrapper (const value_type &r) | |
Copy-construct wrapped type instance from given object. More... | |
cow_wrapper (value_type &&r) | |
Move-construct wrapped type instance from given object. More... | |
cow_wrapper (const cow_wrapper &rSrc) | |
Shallow-copy given cow_wrapper. More... | |
cow_wrapper (cow_wrapper &&rSrc) noexcept | |
Move-construct and steal rSrc shared resource. More... | |
cow_wrapper (std::nullopt_t) noexcept | |
cow_wrapper (const cow_wrapper &rSrc, std::nullopt_t) | |
~cow_wrapper () | |
cow_wrapper & | operator= (const cow_wrapper &rSrc) |
now sharing rSrc cow_wrapper instance with us More... | |
cow_wrapper & | operator= (cow_wrapper &&rSrc) noexcept |
stealing rSrc's resource More... | |
value_type & | make_unique () |
unshare with any other cow_wrapper instance More... | |
bool | is_unique () const |
true, if not shared with any other cow_wrapper instance More... | |
MTPolicy::ref_count_t | use_count () const |
return number of shared instances (1 for unique object) More... | |
void | swap (cow_wrapper &r) |
pointer | operator-> () |
value_type & | operator* () |
const_pointer | operator-> () const |
const value_type & | operator* () const |
pointer | get () |
const_pointer | get () const |
bool | same_object (const cow_wrapper &rOther) const |
true, if both cow_wrapper internally share the same object More... | |
bool | empty () const |
void | set_empty () |
Private Member Functions | |
void | release () |
Private Attributes | |
impl_t * | m_pimpl |
Definition at line 171 of file cow_wrapper.hxx.
typedef const T* o3tl::cow_wrapper< T, MTPolicy >::const_pointer |
Definition at line 215 of file cow_wrapper.hxx.
typedef MTPolicy o3tl::cow_wrapper< T, MTPolicy >::mt_policy |
Definition at line 216 of file cow_wrapper.hxx.
typedef T* o3tl::cow_wrapper< T, MTPolicy >::pointer |
Definition at line 214 of file cow_wrapper.hxx.
typedef T o3tl::cow_wrapper< T, MTPolicy >::value_type |
Definition at line 213 of file cow_wrapper.hxx.
|
inline |
Default-construct wrapped type instance.
Definition at line 220 of file cow_wrapper.hxx.
|
inlineexplicit |
Copy-construct wrapped type instance from given object.
Definition at line 227 of file cow_wrapper.hxx.
|
inlineexplicit |
Move-construct wrapped type instance from given object.
Definition at line 234 of file cow_wrapper.hxx.
|
inlineexplicit |
Shallow-copy given cow_wrapper.
Definition at line 241 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count.
|
inlineexplicitnoexcept |
Move-construct and steal rSrc shared resource.
Definition at line 249 of file cow_wrapper.hxx.
|
inlineexplicitnoexcept |
Definition at line 256 of file cow_wrapper.hxx.
|
inlineexplicit |
Definition at line 262 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count.
|
inline |
Definition at line 269 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::release().
|
inline |
Definition at line 343 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl.
|
inline |
Definition at line 333 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::make_unique().
|
inline |
Definition at line 334 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_value.
|
inline |
true, if not shared with any other cow_wrapper instance
Definition at line 312 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count.
|
inline |
unshare with any other cow_wrapper instance
Definition at line 299 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count, o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_value, and o3tl::cow_wrapper< T, MTPolicy >::release().
Referenced by o3tl::cow_wrapper< T, MTPolicy >::get(), o3tl::cow_wrapper< T, MTPolicy >::operator*(), and o3tl::cow_wrapper< T, MTPolicy >::operator->().
|
inline |
Definition at line 329 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::make_unique().
|
inline |
Definition at line 331 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_value.
|
inline |
Definition at line 328 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::make_unique().
|
inline |
Definition at line 330 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_value.
|
inline |
now sharing rSrc cow_wrapper instance with us
Definition at line 275 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count, and o3tl::cow_wrapper< T, MTPolicy >::release().
|
inlinenoexcept |
stealing rSrc's resource
Definition at line 287 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::release().
|
inlineprivate |
Definition at line 203 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count.
Referenced by o3tl::cow_wrapper< T, MTPolicy >::make_unique(), o3tl::cow_wrapper< T, MTPolicy >::operator=(), o3tl::cow_wrapper< T, MTPolicy >::set_empty(), and o3tl::cow_wrapper< T, MTPolicy >::~cow_wrapper().
|
inline |
true, if both cow_wrapper internally share the same object
Definition at line 337 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl.
|
inline |
Definition at line 345 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::release().
|
inline |
Definition at line 323 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::swap().
|
inline |
return number of shared instances (1 for unique object)
Definition at line 318 of file cow_wrapper.hxx.
References o3tl::cow_wrapper< T, MTPolicy >::m_pimpl, and o3tl::cow_wrapper< T, MTPolicy >::impl_t::m_ref_count.
|
private |
Definition at line 355 of file cow_wrapper.hxx.
Referenced by o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper(), o3tl::cow_wrapper< T, MTPolicy >::empty(), o3tl::cow_wrapper< T, MTPolicy >::get(), o3tl::cow_wrapper< T, MTPolicy >::is_unique(), o3tl::cow_wrapper< T, MTPolicy >::make_unique(), o3tl::cow_wrapper< T, MTPolicy >::operator*(), o3tl::cow_wrapper< T, MTPolicy >::operator->(), o3tl::cow_wrapper< T, MTPolicy >::operator=(), o3tl::cow_wrapper< T, MTPolicy >::release(), o3tl::cow_wrapper< T, MTPolicy >::same_object(), o3tl::cow_wrapper< T, MTPolicy >::set_empty(), o3tl::cow_wrapper< T, MTPolicy >::swap(), and o3tl::cow_wrapper< T, MTPolicy >::use_count().