LibreOffice Module o3tl (master) 1
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
o3tl::cow_wrapper< T, MTPolicy > Class Template Reference

#include <cow_wrapper.hxx>

Inheritance diagram for o3tl::cow_wrapper< T, MTPolicy >:
[legend]
Collaboration diagram for o3tl::cow_wrapper< T, MTPolicy >:
[legend]

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_wrapperoperator= (const cow_wrapper &rSrc)
 now sharing rSrc cow_wrapper instance with us More...
 
cow_wrapperoperator= (cow_wrapper &&rSrc) noexcept
 stealing rSrc's resource More...
 
value_typemake_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_typeoperator* ()
 
const_pointer operator-> () const
 
const value_typeoperator* () 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_tm_pimpl
 

Detailed Description

template<typename T, class MTPolicy = UnsafeRefCountingPolicy>
class o3tl::cow_wrapper< T, MTPolicy >

Definition at line 171 of file cow_wrapper.hxx.

Member Typedef Documentation

◆ const_pointer

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
typedef const T* o3tl::cow_wrapper< T, MTPolicy >::const_pointer

◆ mt_policy

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
typedef MTPolicy o3tl::cow_wrapper< T, MTPolicy >::mt_policy

◆ pointer

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
typedef T* o3tl::cow_wrapper< T, MTPolicy >::pointer

◆ value_type

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
typedef T o3tl::cow_wrapper< T, MTPolicy >::value_type

Constructor & Destructor Documentation

◆ cow_wrapper() [1/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( )
inline

Default-construct wrapped type instance.

Examples
/home/tdf/lode/jenkins/workspace/lo_tb_master_linux_dbg/include/o3tl/cow_wrapper.hxx.

Definition at line 220 of file cow_wrapper.hxx.

◆ cow_wrapper() [2/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( const value_type r)
inlineexplicit

Copy-construct wrapped type instance from given object.

Definition at line 227 of file cow_wrapper.hxx.

◆ cow_wrapper() [3/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( value_type &&  r)
inlineexplicit

Move-construct wrapped type instance from given object.

Definition at line 234 of file cow_wrapper.hxx.

◆ cow_wrapper() [4/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( const cow_wrapper< T, MTPolicy > &  rSrc)
inlineexplicit

◆ cow_wrapper() [5/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( cow_wrapper< T, MTPolicy > &&  rSrc)
inlineexplicitnoexcept

Move-construct and steal rSrc shared resource.

Definition at line 249 of file cow_wrapper.hxx.

◆ cow_wrapper() [6/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( std::nullopt_t  )
inlineexplicitnoexcept

Definition at line 256 of file cow_wrapper.hxx.

◆ cow_wrapper() [7/7]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::cow_wrapper ( const cow_wrapper< T, MTPolicy > &  rSrc,
std::nullopt_t   
)
inlineexplicit

◆ ~cow_wrapper()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
o3tl::cow_wrapper< T, MTPolicy >::~cow_wrapper ( )
inline

Member Function Documentation

◆ empty()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
bool o3tl::cow_wrapper< T, MTPolicy >::empty ( ) const
inline

◆ get() [1/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
pointer o3tl::cow_wrapper< T, MTPolicy >::get ( )
inline

◆ get() [2/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
const_pointer o3tl::cow_wrapper< T, MTPolicy >::get ( ) const
inline

◆ is_unique()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
bool o3tl::cow_wrapper< T, MTPolicy >::is_unique ( ) const
inline

◆ make_unique()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
value_type & o3tl::cow_wrapper< T, MTPolicy >::make_unique ( )
inline

◆ operator*() [1/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
value_type & o3tl::cow_wrapper< T, MTPolicy >::operator* ( )
inline

◆ operator*() [2/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
const value_type & o3tl::cow_wrapper< T, MTPolicy >::operator* ( ) const
inline

◆ operator->() [1/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
pointer o3tl::cow_wrapper< T, MTPolicy >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
const_pointer o3tl::cow_wrapper< T, MTPolicy >::operator-> ( ) const
inline

◆ operator=() [1/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
cow_wrapper & o3tl::cow_wrapper< T, MTPolicy >::operator= ( const cow_wrapper< T, MTPolicy > &  rSrc)
inline

◆ operator=() [2/2]

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
cow_wrapper & o3tl::cow_wrapper< T, MTPolicy >::operator= ( cow_wrapper< T, MTPolicy > &&  rSrc)
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().

◆ release()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
void o3tl::cow_wrapper< T, MTPolicy >::release ( )
inlineprivate

◆ same_object()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
bool o3tl::cow_wrapper< T, MTPolicy >::same_object ( const cow_wrapper< T, MTPolicy > &  rOther) const
inline

◆ set_empty()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
void o3tl::cow_wrapper< T, MTPolicy >::set_empty ( )
inline

◆ swap()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
void o3tl::cow_wrapper< T, MTPolicy >::swap ( cow_wrapper< T, MTPolicy > &  r)
inline

◆ use_count()

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
MTPolicy::ref_count_t o3tl::cow_wrapper< T, MTPolicy >::use_count ( ) const
inline

Member Data Documentation

◆ m_pimpl

template<typename T , class MTPolicy = UnsafeRefCountingPolicy>
impl_t* o3tl::cow_wrapper< T, MTPolicy >::m_pimpl
private

The documentation for this class was generated from the following file: