libzypp 17.37.17
zypp::RWCOW_pointer< D, DTraits > Struct Template Reference

RW_pointer supporting 'copy on write' functionality. More...

#include <zypp-core/base/PtrTypes.h>

Public Types

using PtrType = typename DTraits::PtrType
using constPtrType = typename DTraits::constPtrType

Public Member Functions

 RWCOW_pointer ()
 RWCOW_pointer (std::nullptr_t)
 RWCOW_pointer (const RWCOW_pointer &)=default
 RWCOW_pointer (RWCOW_pointer &&)=default
 RWCOW_pointer (typename PtrType::element_type *dptr)
 RWCOW_pointer (PtrType dptr)
RWCOW_pointeroperator= (std::nullptr_t)
RWCOW_pointeroperator= (const RWCOW_pointer &)=default
RWCOW_pointeroperator= (RWCOW_pointer &&)=default
void reset ()
void reset (typename PtrType::element_type *dptr)
void swap (RWCOW_pointer &rhs) noexcept
void swap (PtrType &rhs) noexcept
 operator bool () const
const D & operator* () const
const D * operator-> () const
const D * get () const
D & operator* ()
D * operator-> ()
D * get ()
bool unique () const
long use_count () const
constPtrType getPtr () const
PtrType getPtr ()
constPtrType cgetPtr ()

Private Member Functions

void assertUnshared ()

Private Attributes

PtrType _dptr

(Note that these are not member symbols.)

template<class D>
D * rwcowClone (const D *rhs)
 Clone the underlying object.
template<class D, class DPtr>
std::ostream & operator<< (std::ostream &str, const RWCOW_pointer< D, DPtr > &obj)
 Stream output.
template<class D, class DPtr>
bool operator== (const RWCOW_pointer< D, DPtr > &lhs, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator== (const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
template<class D, class DPtr>
bool operator== (const typename DPtr::PtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator== (const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
template<class D, class DPtr>
bool operator== (const typename DPtr::constPtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator== (const RWCOW_pointer< D, DPtr > &lhs, std::nullptr_t)
template<class D, class DPtr>
bool operator== (std::nullptr_t, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator!= (const RWCOW_pointer< D, DPtr > &lhs, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator!= (const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
template<class D, class DPtr>
bool operator!= (const typename DPtr::PtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator!= (const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
template<class D, class DPtr>
bool operator!= (const typename DPtr::constPtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
template<class D, class DPtr>
bool operator!= (const RWCOW_pointer< D, DPtr > &lhs, std::nullptr_t)
template<class D, class DPtr>
bool operator!= (std::nullptr_t, const RWCOW_pointer< D, DPtr > &rhs)

Detailed Description

template<class D, class DTraits = rw_pointer::Shared<D>>
struct zypp::RWCOW_pointer< D, DTraits >

RW_pointer supporting 'copy on write' functionality.

Write access to the underlying object creates a copy, iff the object is shared.

See RW_pointer.

Definition at line 468 of file PtrTypes.h.

Member Typedef Documentation

◆ PtrType

template<class D, class DTraits = rw_pointer::Shared<D>>
using zypp::RWCOW_pointer< D, DTraits >::PtrType = typename DTraits::PtrType

Definition at line 470 of file PtrTypes.h.

◆ constPtrType

template<class D, class DTraits = rw_pointer::Shared<D>>
using zypp::RWCOW_pointer< D, DTraits >::constPtrType = typename DTraits::constPtrType

Definition at line 471 of file PtrTypes.h.

Constructor & Destructor Documentation

◆ RWCOW_pointer() [1/6]

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::RWCOW_pointer ( )
inline

Definition at line 473 of file PtrTypes.h.

◆ RWCOW_pointer() [2/6]

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::RWCOW_pointer ( std::nullptr_t )
inline

Definition at line 475 of file PtrTypes.h.

◆ RWCOW_pointer() [3/6]

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::RWCOW_pointer ( const RWCOW_pointer< D, DTraits > & )
default

◆ RWCOW_pointer() [4/6]

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::RWCOW_pointer ( RWCOW_pointer< D, DTraits > && )
default

◆ RWCOW_pointer() [5/6]

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::RWCOW_pointer ( typename PtrType::element_type * dptr)
inlineexplicit

Definition at line 482 of file PtrTypes.h.

◆ RWCOW_pointer() [6/6]

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::RWCOW_pointer ( PtrType dptr)
inlineexplicit

Definition at line 487 of file PtrTypes.h.

Member Function Documentation

◆ operator=() [1/3]

template<class D, class DTraits = rw_pointer::Shared<D>>
RWCOW_pointer & zypp::RWCOW_pointer< D, DTraits >::operator= ( std::nullptr_t )
inline

Definition at line 491 of file PtrTypes.h.

◆ operator=() [2/3]

template<class D, class DTraits = rw_pointer::Shared<D>>
RWCOW_pointer & zypp::RWCOW_pointer< D, DTraits >::operator= ( const RWCOW_pointer< D, DTraits > & )
default

◆ operator=() [3/3]

template<class D, class DTraits = rw_pointer::Shared<D>>
RWCOW_pointer & zypp::RWCOW_pointer< D, DTraits >::operator= ( RWCOW_pointer< D, DTraits > && )
default

◆ reset() [1/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
void zypp::RWCOW_pointer< D, DTraits >::reset ( )
inline

Definition at line 498 of file PtrTypes.h.

◆ reset() [2/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
void zypp::RWCOW_pointer< D, DTraits >::reset ( typename PtrType::element_type * dptr)
inline

Definition at line 501 of file PtrTypes.h.

◆ swap() [1/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
void zypp::RWCOW_pointer< D, DTraits >::swap ( RWCOW_pointer< D, DTraits > & rhs)
inlinenoexcept

Definition at line 504 of file PtrTypes.h.

◆ swap() [2/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
void zypp::RWCOW_pointer< D, DTraits >::swap ( PtrType & rhs)
inlinenoexcept

Definition at line 507 of file PtrTypes.h.

◆ operator bool()

template<class D, class DTraits = rw_pointer::Shared<D>>
zypp::RWCOW_pointer< D, DTraits >::operator bool ( ) const
inlineexplicit

Definition at line 510 of file PtrTypes.h.

◆ operator*() [1/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
const D & zypp::RWCOW_pointer< D, DTraits >::operator* ( ) const
inline

Definition at line 513 of file PtrTypes.h.

◆ operator->() [1/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
const D * zypp::RWCOW_pointer< D, DTraits >::operator-> ( ) const
inline

Definition at line 516 of file PtrTypes.h.

◆ get() [1/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
const D * zypp::RWCOW_pointer< D, DTraits >::get ( ) const
inline

Definition at line 519 of file PtrTypes.h.

◆ operator*() [2/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
D & zypp::RWCOW_pointer< D, DTraits >::operator* ( )
inline

Definition at line 522 of file PtrTypes.h.

◆ operator->() [2/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
D * zypp::RWCOW_pointer< D, DTraits >::operator-> ( )
inline

Definition at line 525 of file PtrTypes.h.

◆ get() [2/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
D * zypp::RWCOW_pointer< D, DTraits >::get ( )
inline

Definition at line 528 of file PtrTypes.h.

◆ unique()

template<class D, class DTraits = rw_pointer::Shared<D>>
bool zypp::RWCOW_pointer< D, DTraits >::unique ( ) const
inline

Definition at line 532 of file PtrTypes.h.

◆ use_count()

template<class D, class DTraits = rw_pointer::Shared<D>>
long zypp::RWCOW_pointer< D, DTraits >::use_count ( ) const
inline

Definition at line 535 of file PtrTypes.h.

◆ getPtr() [1/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
constPtrType zypp::RWCOW_pointer< D, DTraits >::getPtr ( ) const
inline

Definition at line 538 of file PtrTypes.h.

◆ getPtr() [2/2]

template<class D, class DTraits = rw_pointer::Shared<D>>
PtrType zypp::RWCOW_pointer< D, DTraits >::getPtr ( )
inline

Definition at line 541 of file PtrTypes.h.

◆ cgetPtr()

template<class D, class DTraits = rw_pointer::Shared<D>>
constPtrType zypp::RWCOW_pointer< D, DTraits >::cgetPtr ( )
inline

Definition at line 544 of file PtrTypes.h.

◆ assertUnshared()

template<class D, class DTraits = rw_pointer::Shared<D>>
void zypp::RWCOW_pointer< D, DTraits >::assertUnshared ( )
inlineprivate

Definition at line 549 of file PtrTypes.h.

◆ rwcowClone()

template<class D>
D * rwcowClone ( const D * rhs)
related

Clone the underlying object.

Calls rhs ->clone(). Being defined as a function outside RWCOW_pointer allows to overload it, in case a specific D does not have clone().

Definition at line 453 of file PtrTypes.h.

◆ operator<<()

template<class D, class DPtr>
std::ostream & operator<< ( std::ostream & str,
const RWCOW_pointer< D, DPtr > & obj )
related

Stream output.

Print the D object the RWCOW_pointer refers, or "NULL" if the pointer is NULL.

Definition at line 566 of file PtrTypes.h.

◆ operator==() [1/7]

template<class D, class DPtr>
bool operator== ( const RWCOW_pointer< D, DPtr > & lhs,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 575 of file PtrTypes.h.

◆ operator==() [2/7]

template<class D, class DPtr>
bool operator== ( const RWCOW_pointer< D, DPtr > & lhs,
const typename DPtr::PtrType & rhs )
related

Definition at line 579 of file PtrTypes.h.

◆ operator==() [3/7]

template<class D, class DPtr>
bool operator== ( const typename DPtr::PtrType & lhs,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 583 of file PtrTypes.h.

◆ operator==() [4/7]

template<class D, class DPtr>
bool operator== ( const RWCOW_pointer< D, DPtr > & lhs,
const typename DPtr::constPtrType & rhs )
related

Definition at line 587 of file PtrTypes.h.

◆ operator==() [5/7]

template<class D, class DPtr>
bool operator== ( const typename DPtr::constPtrType & lhs,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 591 of file PtrTypes.h.

◆ operator==() [6/7]

template<class D, class DPtr>
bool operator== ( const RWCOW_pointer< D, DPtr > & lhs,
std::nullptr_t  )
related

Definition at line 595 of file PtrTypes.h.

◆ operator==() [7/7]

template<class D, class DPtr>
bool operator== ( std::nullptr_t ,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 599 of file PtrTypes.h.

◆ operator!=() [1/7]

template<class D, class DPtr>
bool operator!= ( const RWCOW_pointer< D, DPtr > & lhs,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 604 of file PtrTypes.h.

◆ operator!=() [2/7]

template<class D, class DPtr>
bool operator!= ( const RWCOW_pointer< D, DPtr > & lhs,
const typename DPtr::PtrType & rhs )
related

Definition at line 608 of file PtrTypes.h.

◆ operator!=() [3/7]

template<class D, class DPtr>
bool operator!= ( const typename DPtr::PtrType & lhs,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 612 of file PtrTypes.h.

◆ operator!=() [4/7]

template<class D, class DPtr>
bool operator!= ( const RWCOW_pointer< D, DPtr > & lhs,
const typename DPtr::constPtrType & rhs )
related

Definition at line 616 of file PtrTypes.h.

◆ operator!=() [5/7]

template<class D, class DPtr>
bool operator!= ( const typename DPtr::constPtrType & lhs,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 620 of file PtrTypes.h.

◆ operator!=() [6/7]

template<class D, class DPtr>
bool operator!= ( const RWCOW_pointer< D, DPtr > & lhs,
std::nullptr_t  )
related

Definition at line 624 of file PtrTypes.h.

◆ operator!=() [7/7]

template<class D, class DPtr>
bool operator!= ( std::nullptr_t ,
const RWCOW_pointer< D, DPtr > & rhs )
related

Definition at line 628 of file PtrTypes.h.

Member Data Documentation

◆ _dptr

template<class D, class DTraits = rw_pointer::Shared<D>>
PtrType zypp::RWCOW_pointer< D, DTraits >::_dptr
private

Definition at line 556 of file PtrTypes.h.


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