|
(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) |
|
template<class _D, class _Traits = rw_pointer::Shared<_D>>
struct zypp::RW_pointer< _D, _Traits >
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>
.
- See Also
- zypp::RWCOW_pointer for 'copy on write' functionality.
* #include "zypp/base/PtrTypes.h"
*
* class Foo
* {
* ...
* private:
*
* struct Impl;
*
* RW_pointer<Impl> _pimpl;
*
* void baa() { _pimpl->... }
* void baa() const { _pimpl->... }
* };
*
Definition at line 265 of file PtrTypes.h.