libzypp
13.10.6
|
Wrapper for const
correct access via Smart pointer types.
More...
#include <PtrTypes.h>
Public Types | |
typedef _Traits::_Ptr | _Ptr |
typedef _Traits::_constPtr | _constPtr |
Public Member Functions | |
RW_pointer () | |
RW_pointer (std::nullptr_t) | |
RW_pointer (typename _Ptr::element_type *dptr) | |
RW_pointer (_Ptr dptr) | |
RW_pointer & | operator= (std::nullptr_t) |
void | reset () |
void | reset (typename _Ptr::element_type *dptr) |
void | swap (RW_pointer &rhs) |
void | swap (_Ptr &rhs) |
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 |
_constPtr | getPtr () const |
_Ptr | getPtr () |
_constPtr | cgetPtr () |
Private Attributes | |
_Ptr | _dptr |
Related Functions | |
(Note that these are not member functions.) | |
template<class _D , class _Ptr > | |
std::ostream & | operator<< (std::ostream &str, const RW_pointer< _D, _Ptr > &obj) |
template<class _D , class _Ptr > | |
bool | operator== (const RW_pointer< _D, _Ptr > &lhs, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator== (const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_Ptr &rhs) |
template<class _D , class _Ptr > | |
bool | operator== (const typename _Ptr::_Ptr &lhs, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator== (const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_constPtr &rhs) |
template<class _D , class _Ptr > | |
bool | operator== (const typename _Ptr::_constPtr &lhs, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator== (const RW_pointer< _D, _Ptr > &lhs, std::nullptr_t) |
template<class _D , class _Ptr > | |
bool | operator== (std::nullptr_t, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator!= (const RW_pointer< _D, _Ptr > &lhs, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator!= (const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_Ptr &rhs) |
template<class _D , class _Ptr > | |
bool | operator!= (const typename _Ptr::_Ptr &lhs, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator!= (const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_constPtr &rhs) |
template<class _D , class _Ptr > | |
bool | operator!= (const typename _Ptr::_constPtr &lhs, const RW_pointer< _D, _Ptr > &rhs) |
template<class _D , class _Ptr > | |
bool | operator!= (const RW_pointer< _D, _Ptr > &lhs, std::nullptr_t) |
template<class _D , class _Ptr > | |
bool | operator!= (std::nullptr_t, const RW_pointer< _D, _Ptr > &rhs) |
Wrapper for const
correct access via Smart pointer types.
zypp::RW_pointer<tt><_D,_Traits> stores a Smart pointer types of type _Traits::_Ptr
, which must be convertible into a _D *
. Pointer style access (via ->
and *
) offers a const _D *
in const a context, otherwise a _D *
. Thus RW_ means read/write, as you get a different type, dependent on whether you're allowed to read or write.
Forwarding access from an interface to an implemantation class, an RW_pointer prevents const interface methods from accidentally calling nonconst implementation methods.
The second template argument defaults to _Traits = rw_pointer::Shared<_D>
thus wraping a shared_ptr<_D>
. To wrap an intrusive_ptr<_D>
use rw_pointer::Intrusive<_D>
.
Definition at line 265 of file PtrTypes.h.
typedef _Traits::_Ptr zypp::RW_pointer< _D, _Traits >::_Ptr |
Definition at line 267 of file PtrTypes.h.
typedef _Traits::_constPtr zypp::RW_pointer< _D, _Traits >::_constPtr |
Definition at line 268 of file PtrTypes.h.
|
inline |
Definition at line 270 of file PtrTypes.h.
|
inline |
Definition at line 273 of file PtrTypes.h.
|
inlineexplicit |
Definition at line 277 of file PtrTypes.h.
|
inlineexplicit |
Definition at line 282 of file PtrTypes.h.
|
inline |
Definition at line 286 of file PtrTypes.h.
|
inline |
Definition at line 289 of file PtrTypes.h.
|
inline |
Definition at line 292 of file PtrTypes.h.
|
inline |
Definition at line 295 of file PtrTypes.h.
|
inline |
Definition at line 298 of file PtrTypes.h.
|
inlineexplicit |
Definition at line 301 of file PtrTypes.h.
|
inline |
Definition at line 304 of file PtrTypes.h.
|
inline |
Definition at line 307 of file PtrTypes.h.
|
inline |
Definition at line 310 of file PtrTypes.h.
|
inline |
Definition at line 313 of file PtrTypes.h.
|
inline |
Definition at line 316 of file PtrTypes.h.
|
inline |
Definition at line 319 of file PtrTypes.h.
|
inline |
Definition at line 323 of file PtrTypes.h.
|
inline |
Definition at line 326 of file PtrTypes.h.
|
inline |
Definition at line 329 of file PtrTypes.h.
|
inline |
Definition at line 332 of file PtrTypes.h.
|
inline |
Definition at line 335 of file PtrTypes.h.
|
private |
Definition at line 339 of file PtrTypes.h.