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 ()
 
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...
 

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 175 of file cow_wrapper.hxx.

Member Typedef Documentation

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

Constructor & Destructor Documentation

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 224 of file cow_wrapper.hxx.

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 231 of file cow_wrapper.hxx.

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 238 of file cow_wrapper.hxx.

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

Shallow-copy given cow_wrapper.

Definition at line 245 of file cow_wrapper.hxx.

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 253 of file cow_wrapper.hxx.

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

Member Function Documentation

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

Definition at line 323 of file cow_wrapper.hxx.

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

Definition at line 324 of file cow_wrapper.hxx.

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

true, if not shared with any other cow_wrapper instance

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

Definition at line 302 of file cow_wrapper.hxx.

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

Definition at line 321 of file cow_wrapper.hxx.

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

Definition at line 320 of file cow_wrapper.hxx.

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

now sharing rSrc cow_wrapper instance with us

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

Definition at line 265 of file cow_wrapper.hxx.

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 277 of file cow_wrapper.hxx.

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

true, if both cow_wrapper internally share the same object

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

Definition at line 327 of file cow_wrapper.hxx.

Referenced by o3tl::operator!=(), and o3tl::operator==().

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

return number of shared instances (1 for unique object)

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

Definition at line 308 of file cow_wrapper.hxx.

Member Data Documentation

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: