libzypp  17.36.3
Smart pointer types

Smart pointer types. More...

Files

file  PtrTypes.h
 

Namespaces

 zypp::rw_pointer
 Don't forgett to provide versions for PtrType and constPtrType, esp.
 

Classes

struct  zypp::NullDeleter
 shared_ptr custom deleter doing nothing. More...
 
struct  zypp::RW_pointer< D, DTraits >
 Wrapper for const correct access via Smart pointer types. More...
 
struct  zypp::RWCOW_pointer< D, DTraits >
 RW_pointer supporting 'copy on write' functionality. More...
 
class  scoped_ptr
 
class  shared_ptr
 
class  weak_ptr
 
class  intrusive_ptr
 

Functions

std::string zypp::str::form (const char *format,...) __attribute__((format(printf
 Printf style construction of std::string. More...
 
void zypp::NullDeleter::operator() (const void *const) const
 
template<typename T , typename... Args>
intrusive_ptr< T > zypp::make_intrusive (Args &&... __args)
 
template<>
std::ostream & std::operator<< (std::ostream &str, const zypp::shared_ptr< void > &obj)
 
template<>
std::ostream & std::dumpOn (std::ostream &str, const zypp::shared_ptr< void > &obj)
 
template<class D , class DPtr >
std::ostream & operator<< (std::ostream &str, const RW_pointer< D, DPtr > &obj)
 
template<class D , class DPtr >
bool operator== (const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator== (const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
 
template<class D , class DPtr >
bool operator== (const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator== (const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
 
template<class D , class DPtr >
bool operator== (const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator== (const RW_pointer< D, DPtr > &lhs, std::nullptr_t)
 
template<class D , class DPtr >
bool operator== (std::nullptr_t, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator!= (const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator!= (const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
 
template<class D , class DPtr >
bool operator!= (const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator!= (const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
 
template<class D , class DPtr >
bool operator!= (const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs)
 
template<class D , class DPtr >
bool operator!= (const RW_pointer< D, DPtr > &lhs, std::nullptr_t)
 
template<class D , class DPtr >
bool operator!= (std::nullptr_t, const RW_pointer< D, DPtr > &rhs)
 
template<class D >
D * rwcowClone (const D *rhs)
 
template<class D , class DPtr >
std::ostream & operator<< (std::ostream &str, const RWCOW_pointer< D, DPtr > &obj)
 
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

Smart pointer types.

Namespace zypp provides 3 smart pointer types using the boost smart pointer library.

And zypp::RW_pointer, as wrapper around a smart pointer, poviding const correct read/write access to the object it refers.

Function Documentation

◆ form()

std::string zypp::str::form ( const char *  format,
  ... 
)

Printf style construction of std::string.

Definition at line 37 of file String.cc.

◆ operator()()

void zypp::NullDeleter::operator() ( const void *  const) const
inline

Definition at line 85 of file PtrTypes.h.

◆ make_intrusive()

template<typename T , typename... Args>
intrusive_ptr<T> zypp::make_intrusive ( Args &&...  __args)
inline

Definition at line 103 of file PtrTypes.h.

◆ operator<<() [1/3]

template<>
std::ostream& std::operator<< ( std::ostream &  str,
const zypp::shared_ptr< void > &  obj 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 141 of file PtrTypes.h.

◆ dumpOn()

template<>
std::ostream& std::dumpOn ( std::ostream &  str,
const zypp::shared_ptr< void > &  obj 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 158 of file PtrTypes.h.

◆ operator<<() [2/3]

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

Stream output.

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

Definition at line 379 of file PtrTypes.h.

◆ operator==() [1/14]

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

Definition at line 388 of file PtrTypes.h.

◆ operator==() [2/14]

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

Definition at line 392 of file PtrTypes.h.

◆ operator==() [3/14]

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

Definition at line 396 of file PtrTypes.h.

◆ operator==() [4/14]

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

Definition at line 400 of file PtrTypes.h.

◆ operator==() [5/14]

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

Definition at line 404 of file PtrTypes.h.

◆ operator==() [6/14]

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

Definition at line 408 of file PtrTypes.h.

◆ operator==() [7/14]

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

Definition at line 412 of file PtrTypes.h.

◆ operator!=() [1/14]

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

Definition at line 418 of file PtrTypes.h.

◆ operator!=() [2/14]

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

Definition at line 422 of file PtrTypes.h.

◆ operator!=() [3/14]

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

Definition at line 426 of file PtrTypes.h.

◆ operator!=() [4/14]

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

Definition at line 430 of file PtrTypes.h.

◆ operator!=() [5/14]

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

Definition at line 434 of file PtrTypes.h.

◆ operator!=() [6/14]

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

Definition at line 438 of file PtrTypes.h.

◆ operator!=() [7/14]

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

Definition at line 442 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<<() [3/3]

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==() [8/14]

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==() [9/14]

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==() [10/14]

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==() [11/14]

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==() [12/14]

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==() [13/14]

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==() [14/14]

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!=() [8/14]

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!=() [9/14]

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!=() [10/14]

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!=() [11/14]

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!=() [12/14]

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!=() [13/14]

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!=() [14/14]

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.