libzypp 17.32.5
|
Wrapper for const
correct access via Smart pointer types.
More...
#include <zypp-core/base/PtrTypes.h>
Public Types | |
using | PtrType = typename DTraits::PtrType |
using | constPtrType = typename DTraits::constPtrType |
Public Member Functions | |
RW_pointer () | |
RW_pointer (const RW_pointer &)=default | |
RW_pointer (RW_pointer &&)=default | |
RW_pointer & | operator= (const RW_pointer &)=default |
RW_pointer & | operator= (RW_pointer &&)=default |
RW_pointer (std::nullptr_t) | |
RW_pointer (typename PtrType::element_type *dptr) | |
RW_pointer (PtrType dptr) | |
RW_pointer & | operator= (std::nullptr_t) |
void | reset () |
void | reset (typename PtrType::element_type *dptr) |
void | swap (RW_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 Attributes | |
PtrType | _dptr |
Related Symbols | |
(Note that these are not member symbols.) | |
template<class D , class DPtr > | |
std::ostream & | operator<< (std::ostream &str, const RW_pointer< D, DPtr > &obj) |
Stream output. | |
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) |
Wrapper for const
correct access via Smart pointer types.
zypp::RW_pointer<D,DTraits>
stores a Smart pointer types of type DTraits::PtrType
, 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 DTraits = rw_pointer::Shared<D>
thus wraping a shared_ptr<D>
. To wrap an intrusive_ptr<D>
use rw_pointer::Intrusive<D>
.
Definition at line 291 of file PtrTypes.h.
using zypp::RW_pointer< D, DTraits >::PtrType = typename DTraits::PtrType |
Definition at line 293 of file PtrTypes.h.
using zypp::RW_pointer< D, DTraits >::constPtrType = typename DTraits::constPtrType |
Definition at line 294 of file PtrTypes.h.
|
inline |
Definition at line 296 of file PtrTypes.h.
|
default |
|
default |
|
inline |
Definition at line 303 of file PtrTypes.h.
|
inlineexplicit |
Definition at line 306 of file PtrTypes.h.
|
inlineexplicit |
Definition at line 311 of file PtrTypes.h.
|
default |
|
default |
|
inline |
Definition at line 315 of file PtrTypes.h.
|
inline |
Definition at line 318 of file PtrTypes.h.
|
inline |
Definition at line 321 of file PtrTypes.h.
|
inlinenoexcept |
Definition at line 324 of file PtrTypes.h.
|
inlinenoexcept |
Definition at line 327 of file PtrTypes.h.
|
inlineexplicit |
Definition at line 330 of file PtrTypes.h.
|
inline |
Definition at line 333 of file PtrTypes.h.
|
inline |
Definition at line 336 of file PtrTypes.h.
|
inline |
Definition at line 339 of file PtrTypes.h.
|
inline |
Definition at line 342 of file PtrTypes.h.
|
inline |
Definition at line 345 of file PtrTypes.h.
|
inline |
Definition at line 348 of file PtrTypes.h.
|
inline |
Definition at line 352 of file PtrTypes.h.
|
inline |
Definition at line 355 of file PtrTypes.h.
|
inline |
Definition at line 358 of file PtrTypes.h.
|
inline |
Definition at line 361 of file PtrTypes.h.
|
inline |
Definition at line 364 of file PtrTypes.h.
|
related |
Stream output.
Print the D
object the RW_pointer refers, or "NULL"
if the pointer is NULL
.
Definition at line 378 of file PtrTypes.h.
|
related |
Definition at line 387 of file PtrTypes.h.
|
related |
Definition at line 391 of file PtrTypes.h.
|
related |
Definition at line 395 of file PtrTypes.h.
|
related |
Definition at line 399 of file PtrTypes.h.
|
related |
Definition at line 403 of file PtrTypes.h.
|
related |
Definition at line 407 of file PtrTypes.h.
|
related |
Definition at line 411 of file PtrTypes.h.
|
related |
Definition at line 417 of file PtrTypes.h.
|
related |
Definition at line 421 of file PtrTypes.h.
|
related |
Definition at line 425 of file PtrTypes.h.
|
related |
Definition at line 429 of file PtrTypes.h.
|
related |
Definition at line 433 of file PtrTypes.h.
|
related |
Definition at line 437 of file PtrTypes.h.
|
related |
Definition at line 441 of file PtrTypes.h.
|
private |
Definition at line 368 of file PtrTypes.h.