libzypp: zypp/base/PtrTypes.h Source File

libzypp 17.25.10

PtrTypes.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #ifndef ZYPP_BASE_PTRTYPES_H
14 #define ZYPP_BASE_PTRTYPES_H
15
16 #include <iosfwd>
17 #include <string>
18
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/shared_ptr.hpp>
21 #include <boost/weak_ptr.hpp>
22 #include <boost/intrusive_ptr.hpp>
23
25 namespace zypp
26 {
27
28 namespace str
29 {
30 // printing void* (prevents us from including <ostream>)
31 std::string form( const char * format, ... ) __attribute__ ((format (printf, 1, 2)));
32 }
33
50
82 struct NullDeleter
83 {
84 void operator()( const void *const ) const
85 {}
86 };
87
89 using boost::scoped_ptr;
90
92 using boost::shared_ptr;
93
95 using boost::weak_ptr;
96
98 using boost::intrusive_ptr;
99
101 using boost::static_pointer_cast;
103 using boost::const_pointer_cast;
105 using boost::dynamic_pointer_cast;
106
108 } // namespace zypp
111 namespace std
112 {
113
114 // namespace sub {
115 // class Foo;
116 // typedef zypp::intrusive_ptr<Foo> Foo_Ptr; // see DEFINE_PTR_TYPE(NAME) macro below
117 // }
118
119 // Defined in namespace std g++ finds the output operator (König-Lookup),
120 // even if we typedef the pointer in a different namespace than ::zypp.
121 // Otherwise we had to define an output operator always in the same namespace
122 // as the typedef (else g++ will just print the pointer value).
123
125 template<class D>
126 inline std::ostream & operator<<( std::ostream & str, const zypp::shared_ptr<D> & obj )
127 {
128 if ( obj )
129 return str << *obj;
130 return str << std::string("NULL");
131 }
133 template<>
134 inline std::ostream & operator<<( std::ostream & str, const zypp::shared_ptr<void> & obj )
135 {
136 if ( obj )
137 return str << zypp::str::form( "%p", (void*)obj.get() );
138 return str << std::string("NULL");
139 }
140
142 template<class D>
143 inline std::ostream & dumpOn( std::ostream & str, const zypp::shared_ptr<D> & obj )
144 {
145 if ( obj )
146 return dumpOn( str, *obj );
147 return str << std::string("NULL");
148 }
150 template<>
151 inline std::ostream & dumpOn( std::ostream & str, const zypp::shared_ptr<void> & obj )
152 { return str << obj; }
153
155 template<class D>
156 inline std::ostream & operator<<( std::ostream & str, const zypp::intrusive_ptr<D> & obj )
157 {
158 if ( obj )
159 return str << *obj;
160 return str << std::string("NULL");
161 }
163 template<class D>
164 inline std::ostream & dumpOn( std::ostream & str, const zypp::intrusive_ptr<D> & obj )
165 {
166 if ( obj )
167 return dumpOn( str, *obj );
168 return str << std::string("NULL");
169 }
171 } // namespace std
174 namespace zypp
175 {
176
178 //
179 // RW_pointer traits
180 //
182
187 namespace rw_pointer {
188
189 template<class D>
190 struct Shared
191 {
192 typedef shared_ptr<D> PtrType;
193 typedef shared_ptr<const D> constPtrType;
195 bool unique( const constPtrType & ptr_r )
196 { return !ptr_r || ptr_r.unique(); }
197 bool unique( const PtrType & ptr_r )
198 { return !ptr_r || ptr_r.unique(); }
200 long use_count( const constPtrType & ptr_r ) const
201 { return ptr_r.use_count(); }
202 long use_count( const PtrType & ptr_r ) const
203 { return ptr_r.use_count(); }
204 };
205
206 template<class D>
207 struct Intrusive
208 {
209 typedef intrusive_ptr<D> PtrType;
210 typedef intrusive_ptr<const D> constPtrType;
212 bool unique( const constPtrType & ptr_r )
213 { return !ptr_r || (ptr_r->refCount() <= 1); }
214 bool unique( const PtrType & ptr_r )
215 { return !ptr_r || (ptr_r->refCount() <= 1); }
217 long use_count( const constPtrType & ptr_r ) const
218 { return ptr_r ? ptr_r->refCount() : 0; }
219 long use_count( const PtrType & ptr_r ) const
220 { return ptr_r ? ptr_r->refCount() : 0; }
221 };
222
223 template<class D>
224 struct Scoped
225 {
226 typedef scoped_ptr<D> PtrType;
227 typedef scoped_ptr<const D> constPtrType;
229 bool unique( const constPtrType & ptr_r )
230 { return true; }
231 bool unique( const PtrType & ptr_r )
232 { return true; }
234 long use_count( const constPtrType & ptr_r ) const
235 { return ptr_r ? 1 : 0; }
236 long use_count( const PtrType & ptr_r ) const
237 { return ptr_r ? 1 : 0; }
238 };
239
240 }
242
244 //
245 // CLASS NAME : RW_pointer
246 //
284 template<class D, class DTraits = rw_pointer::Shared<D> >
285 struct RW_pointer
286 {
287 typedef typename DTraits::PtrType PtrType;
288 typedef typename DTraits::constPtrType constPtrType;
289
290 RW_pointer()
291 {}
292
293 RW_pointer( std::nullptr_t )
294 {}
295
296 explicit
297 RW_pointer( typename PtrType::element_type * dptr )
298 : _dptr( dptr )
299 {}
300
301 explicit
302 RW_pointer( PtrType dptr )
303 : _dptr( dptr )
304 {}
305
306 RW_pointer & operator=( std::nullptr_t )
307 { reset(); return *this; }
308
309 void reset()
310 { PtrType().swap( _dptr ); }
311
312 void reset( typename PtrType::element_type * dptr )
313 { PtrType( dptr ).swap( _dptr ); }
314
315 void swap( RW_pointer & rhs )
316 { _dptr.swap( rhs._dptr ); }
317
318 void swap( PtrType & rhs )
319 { _dptr.swap( rhs ); }
320
321 explicit operator bool() const
322 { return _dptr.get() != nullptr; }
323
324 const D & operator*() const
325 { return *_dptr; };
326
327 const D * operator->() const
328 { return _dptr.operator->(); }
329
330 const D * get() const
331 { return _dptr.get(); }
332
333 D & operator*()
334 { return *_dptr; }
335
336 D * operator->()
337 { return _dptr.operator->(); }
338
339 D * get()
340 { return _dptr.get(); }
341
342 public:
343 bool unique() const
344 { return DTraits().unique( _dptr ); }
345
346 long use_count() const
347 { return DTraits().use_count( _dptr ); }
348
349 constPtrType getPtr() const
350 { return _dptr; }
351
352 PtrType getPtr()
353 { return _dptr; }
354
355 constPtrType cgetPtr()
356 { return _dptr; }
357
358 private:
359 PtrType _dptr;
360 };
362
368 template<class D, class DPtr>
369 inline std::ostream & operator<<( std::ostream & str, const RW_pointer<D, DPtr> & obj )
370 {
371 if ( obj.get() )
372 return str << *obj.get();
373 return str << std::string("NULL");
374 }
375
377 template<class D, class DPtr>
378 inline bool operator==( const RW_pointer<D, DPtr> & lhs, const RW_pointer<D, DPtr> & rhs )
379 { return( lhs.get() == rhs.get() ); }
381 template<class D, class DPtr>
382 inline bool operator==( const RW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
383 { return( lhs.get() == rhs.get() ); }
385 template<class D, class DPtr>
386 inline bool operator==( const typename DPtr::PtrType & lhs, const RW_pointer<D, DPtr> & rhs )
387 { return( lhs.get() == rhs.get() ); }
389 template<class D, class DPtr>
390 inline bool operator==( const RW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
391 { return( lhs.get() == rhs.get() ); }
393 template<class D, class DPtr>
394 inline bool operator==( const typename DPtr::constPtrType & lhs, const RW_pointer<D, DPtr> & rhs )
395 { return( lhs.get() == rhs.get() ); }
397 template<class D, class DPtr>
398 inline bool operator==( const RW_pointer<D, DPtr> & lhs, std::nullptr_t )
399 { return( lhs.get() == nullptr ); }
401 template<class D, class DPtr>
402 inline bool operator==( std::nullptr_t, const RW_pointer<D, DPtr> & rhs )
403 { return( nullptr == rhs.get() ); }
404
405
407 template<class D, class DPtr>
408 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, const RW_pointer<D, DPtr> & rhs )
409 { return ! ( lhs == rhs ); }
411 template<class D, class DPtr>
412 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
413 { return ! ( lhs == rhs ); }
415 template<class D, class DPtr>
416 inline bool operator!=( const typename DPtr::PtrType & lhs, const RW_pointer<D, DPtr> & rhs )
417 { return ! ( lhs == rhs ); }
419 template<class D, class DPtr>
420 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
421 { return ! ( lhs == rhs ); }
423 template<class D, class DPtr>
424 inline bool operator!=( const typename DPtr::constPtrType & lhs, const RW_pointer<D, DPtr> & rhs )
425 { return ! ( lhs == rhs ); }
427 template<class D, class DPtr>
428 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, std::nullptr_t )
429 { return( lhs.get() != nullptr ); }
431 template<class D, class DPtr>
432 inline bool operator!=( std::nullptr_t, const RW_pointer<D, DPtr> & rhs )
433 { return( nullptr != rhs.get() ); }
434
436
442 template<class D>
443 inline D * rwcowClone( const D * rhs )
444 { return rhs->clone(); }
445
447 //
448 // CLASS NAME : RWCOW_pointer
449 //
457 template<class D, class DTraits = rw_pointer::Shared<D> >
458 struct RWCOW_pointer
459 {
460 typedef typename DTraits::PtrType PtrType;
461 typedef typename DTraits::constPtrType constPtrType;
462
463 RWCOW_pointer()
464 {}
465
466 RWCOW_pointer( std::nullptr_t )
467 {}
468
469 explicit
470 RWCOW_pointer( typename PtrType::element_type * dptr )
471 : _dptr( dptr )
472 {}
473
474 explicit
475 RWCOW_pointer( PtrType dptr )
476 : _dptr( dptr )
477 {}
478
479 RWCOW_pointer & operator=( std::nullptr_t )
480 { reset(); return *this; }
481
482 void reset()
483 { PtrType().swap( _dptr ); }
484
485 void reset( typename PtrType::element_type * dptr )
486 { PtrType( dptr ).swap( _dptr ); }
487
488 void swap( RWCOW_pointer & rhs )
489 { _dptr.swap( rhs._dptr ); }
490
491 void swap( PtrType & rhs )
492 { _dptr.swap( rhs ); }
493
494 explicit operator bool() const
495 { return _dptr.get() != nullptr; }
496
497 const D & operator*() const
498 { return *_dptr; };
499
500 const D * operator->() const
501 { return _dptr.operator->(); }
502
503 const D * get() const
504 { return _dptr.get(); }
505
506 D & operator*()
507 { assertUnshared(); return *_dptr; }
508
509 D * operator->()
510 { assertUnshared(); return _dptr.operator->(); }
511
512 D * get()
513 { assertUnshared(); return _dptr.get(); }
514
515 public:
516 bool unique() const
517 { return DTraits().unique( _dptr ); }
518
519 long use_count() const
520 { return DTraits().use_count( _dptr ); }
521
522 constPtrType getPtr() const
523 { return _dptr; }
524
525 PtrType getPtr()
526 { assertUnshared(); return _dptr; }
527
528 constPtrType cgetPtr()
529 { return _dptr; }
530
531 private:
532
533 void assertUnshared()
534 {
535 if ( !unique() )
536 PtrType( rwcowClone( _dptr.get() ) ).swap( _dptr );
537 }
538
539 private:
540 PtrType _dptr;
541 };
543
549 template<class D, class DPtr>
550 inline std::ostream & operator<<( std::ostream & str, const RWCOW_pointer<D, DPtr> & obj )
551 {
552 if ( obj.get() )
553 return str << *obj.get();
554 return str << std::string("NULL");
555 }
556
558 template<class D, class DPtr>
559 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, const RWCOW_pointer<D, DPtr> & rhs )
560 { return( lhs.get() == rhs.get() ); }
562 template<class D, class DPtr>
563 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
564 { return( lhs.get() == rhs.get() ); }
566 template<class D, class DPtr>
567 inline bool operator==( const typename DPtr::PtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
568 { return( lhs.get() == rhs.get() ); }
570 template<class D, class DPtr>
571 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
572 { return( lhs.get() == rhs.get() ); }
574 template<class D, class DPtr>
575 inline bool operator==( const typename DPtr::constPtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
576 { return( lhs.get() == rhs.get() ); }
578 template<class D, class DPtr>
579 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, std::nullptr_t )
580 { return( lhs.get() == nullptr ); }
582 template<class D, class DPtr>
583 inline bool operator==( std::nullptr_t, const RWCOW_pointer<D, DPtr> & rhs )
584 { return( nullptr == rhs.get() ); }
585
587 template<class D, class DPtr>
588 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, const RWCOW_pointer<D, DPtr> & rhs )
589 { return ! ( lhs == rhs ); }
591 template<class D, class DPtr>
592 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
593 { return ! ( lhs == rhs ); }
595 template<class D, class DPtr>
596 inline bool operator!=( const typename DPtr::PtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
597 { return ! ( lhs == rhs ); }
599 template<class D, class DPtr>
600 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
601 { return ! ( lhs == rhs ); }
603 template<class D, class DPtr>
604 inline bool operator!=( const typename DPtr::constPtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
605 { return ! ( lhs == rhs ); }
607 template<class D, class DPtr>
608 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, std::nullptr_t )
609 { return( lhs.get() != nullptr ); }
611 template<class D, class DPtr>
612 inline bool operator!=( std::nullptr_t, const RWCOW_pointer<D, DPtr> & rhs )
613 { return( nullptr != rhs.get() ); }
614
616
619 } // namespace zypp
621
623 #define DEFINE_PTR_TYPE(NAME) \
624 class NAME; \
625 extern void intrusive_ptr_add_ref( const NAME * ); \
626 extern void intrusive_ptr_release( const NAME * ); \
627 typedef zypp::intrusive_ptr<NAME> NAME##_Ptr; \
628 typedef zypp::intrusive_ptr<const NAME> NAME##_constPtr;
629
631 #endif // ZYPP_BASE_PTRTYPES_H
std
Definition: Arch.h:348
std::operator<<
std::ostream & operator<<(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition: PtrTypes.h:134
std::dumpOn
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition: PtrTypes.h:151
str
String related utilities and Regular expression matching.
zypp::str::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:36
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
zypp::NullDeleter
shared_ptr custom deleter doing nothing.
Definition: PtrTypes.h:83
zypp::NullDeleter::operator()
void operator()(const void *const) const
Definition: PtrTypes.h:84
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459
zypp::RWCOW_pointer::operator==
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:559
zypp::RWCOW_pointer::operator!=
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition: PtrTypes.h:592
zypp::RWCOW_pointer::operator!=
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:588
zypp::RWCOW_pointer::get
D * get()
Definition: PtrTypes.h:512
zypp::RWCOW_pointer::operator!=
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:608
zypp::RWCOW_pointer::operator*
const D & operator*() const
Definition: PtrTypes.h:497
zypp::RWCOW_pointer::operator==
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition: PtrTypes.h:563
zypp::RWCOW_pointer::operator=
RWCOW_pointer & operator=(std::nullptr_t)
Definition: PtrTypes.h:479
zypp::RWCOW_pointer::operator==
bool operator==(std::nullptr_t, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:583
zypp::RWCOW_pointer::operator==
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:579
zypp::RWCOW_pointer::cgetPtr
constPtrType cgetPtr()
Definition: PtrTypes.h:528
zypp::RWCOW_pointer::operator!=
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition: PtrTypes.h:600
zypp::RWCOW_pointer::reset
void reset()
Definition: PtrTypes.h:482
zypp::RWCOW_pointer::operator*
D & operator*()
Definition: PtrTypes.h:506
zypp::RWCOW_pointer::operator!=
bool operator!=(std::nullptr_t, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:612
zypp::RWCOW_pointer::get
const D * get() const
Definition: PtrTypes.h:503
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer()
Definition: PtrTypes.h:463
zypp::RWCOW_pointer::operator->
const D * operator->() const
Definition: PtrTypes.h:500
zypp::RWCOW_pointer::getPtr
PtrType getPtr()
Definition: PtrTypes.h:525
zypp::RWCOW_pointer::operator!=
bool operator!=(const typename DPtr::PtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:596
zypp::RWCOW_pointer::operator!=
bool operator!=(const typename DPtr::constPtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:604
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(std::nullptr_t)
Definition: PtrTypes.h:466
zypp::RWCOW_pointer::getPtr
constPtrType getPtr() const
Definition: PtrTypes.h:522
zypp::RWCOW_pointer::operator==
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition: PtrTypes.h:571
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(PtrType dptr)
Definition: PtrTypes.h:475
zypp::RWCOW_pointer::use_count
long use_count() const
Definition: PtrTypes.h:519
zypp::RWCOW_pointer::operator==
bool operator==(const typename DPtr::PtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:567
zypp::RWCOW_pointer::unique
bool unique() const
Definition: PtrTypes.h:516
zypp::RWCOW_pointer::operator==
bool operator==(const typename DPtr::constPtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:575
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(typename PtrType::element_type *dptr)
Definition: PtrTypes.h:470
zypp::RWCOW_pointer::operator<<
std::ostream & operator<<(std::ostream &str, const RWCOW_pointer< D, DPtr > &obj)
Stream output.
Definition: PtrTypes.h:550
zypp::RWCOW_pointer::rwcowClone
D * rwcowClone(const D *rhs)
Clone the underlying object.
Definition: PtrTypes.h:443
zypp::RWCOW_pointer::PtrType
DTraits::PtrType PtrType
Definition: PtrTypes.h:460
zypp::RWCOW_pointer::swap
void swap(RWCOW_pointer &rhs)
Definition: PtrTypes.h:488
zypp::RWCOW_pointer::reset
void reset(typename PtrType::element_type *dptr)
Definition: PtrTypes.h:485
zypp::RWCOW_pointer::constPtrType
DTraits::constPtrType constPtrType
Definition: PtrTypes.h:461
zypp::RWCOW_pointer::operator->
D * operator->()
Definition: PtrTypes.h:509
zypp::RWCOW_pointer::assertUnshared
void assertUnshared()
Definition: PtrTypes.h:533
zypp::RWCOW_pointer::_dptr
PtrType _dptr
Definition: PtrTypes.h:540
zypp::RWCOW_pointer::swap
void swap(PtrType &rhs)
Definition: PtrTypes.h:491
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:286
zypp::RW_pointer::operator->
const D * operator->() const
Definition: PtrTypes.h:327
zypp::RW_pointer::operator*
const D & operator*() const
Definition: PtrTypes.h:324
zypp::RW_pointer::operator!=
bool operator!=(const RW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:428
zypp::RW_pointer::constPtrType
DTraits::constPtrType constPtrType
Definition: PtrTypes.h:288
zypp::RW_pointer::operator!=
bool operator!=(const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition: PtrTypes.h:412
zypp::RW_pointer::RW_pointer
RW_pointer(std::nullptr_t)
Definition: PtrTypes.h:293
zypp::RW_pointer::PtrType
DTraits::PtrType PtrType
Definition: PtrTypes.h:287
zypp::RW_pointer::operator->
D * operator->()
Definition: PtrTypes.h:336
zypp::RW_pointer::operator==
bool operator==(const RW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:398
zypp::RW_pointer::RW_pointer
RW_pointer(typename PtrType::element_type *dptr)
Definition: PtrTypes.h:297
zypp::RW_pointer::operator<<
std::ostream & operator<<(std::ostream &str, const RW_pointer< D, DPtr > &obj)
Stream output.
Definition: PtrTypes.h:369
zypp::RW_pointer::operator==
bool operator==(const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition: PtrTypes.h:382
zypp::RW_pointer::_dptr
PtrType _dptr
Definition: PtrTypes.h:359
zypp::RW_pointer::cgetPtr
constPtrType cgetPtr()
Definition: PtrTypes.h:355
zypp::RW_pointer::use_count
long use_count() const
Definition: PtrTypes.h:346
zypp::RW_pointer::operator!=
bool operator!=(const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:416
zypp::RW_pointer::operator!=
bool operator!=(const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:424
zypp::RW_pointer::reset
void reset()
Definition: PtrTypes.h:309
zypp::RW_pointer::RW_pointer
RW_pointer()
Definition: PtrTypes.h:290
zypp::RW_pointer::reset
void reset(typename PtrType::element_type *dptr)
Definition: PtrTypes.h:312
zypp::RW_pointer::operator!=
bool operator!=(const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition: PtrTypes.h:420
zypp::RW_pointer::RW_pointer
RW_pointer(PtrType dptr)
Definition: PtrTypes.h:302
zypp::RW_pointer::swap
void swap(RW_pointer &rhs)
Definition: PtrTypes.h:315
zypp::RW_pointer::getPtr
constPtrType getPtr() const
Definition: PtrTypes.h:349
zypp::RW_pointer::swap
void swap(PtrType &rhs)
Definition: PtrTypes.h:318
zypp::RW_pointer::get
D * get()
Definition: PtrTypes.h:339
zypp::RW_pointer::operator==
bool operator==(const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition: PtrTypes.h:390
zypp::RW_pointer::operator==
bool operator==(std::nullptr_t, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:402
zypp::RW_pointer::operator!=
bool operator!=(std::nullptr_t, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:432
zypp::RW_pointer::operator*
D & operator*()
Definition: PtrTypes.h:333
zypp::RW_pointer::unique
bool unique() const
Definition: PtrTypes.h:343
zypp::RW_pointer::operator==
bool operator==(const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:386
zypp::RW_pointer::getPtr
PtrType getPtr()
Definition: PtrTypes.h:352
zypp::RW_pointer::operator=
RW_pointer & operator=(std::nullptr_t)
Definition: PtrTypes.h:306
zypp::RW_pointer::operator==
bool operator==(const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:394
zypp::RW_pointer::get
const D * get() const
Definition: PtrTypes.h:330
zypp::RW_pointer::operator!=
bool operator!=(const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:408
zypp::RW_pointer::operator==
bool operator==(const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs)
Definition: PtrTypes.h:378
zypp::rw_pointer::Intrusive
Definition: PtrTypes.h:208
zypp::rw_pointer::Intrusive::use_count
long use_count(const PtrType &ptr_r) const
Definition: PtrTypes.h:219
zypp::rw_pointer::Intrusive::PtrType
intrusive_ptr< D > PtrType
Definition: PtrTypes.h:209
zypp::rw_pointer::Intrusive::use_count
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition: PtrTypes.h:217
zypp::rw_pointer::Intrusive::unique
bool unique(const PtrType &ptr_r)
Definition: PtrTypes.h:214
zypp::rw_pointer::Intrusive::unique
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition: PtrTypes.h:212
zypp::rw_pointer::Intrusive::constPtrType
intrusive_ptr< const D > constPtrType
Definition: PtrTypes.h:210
zypp::rw_pointer::Scoped
Definition: PtrTypes.h:225
zypp::rw_pointer::Scoped::constPtrType
scoped_ptr< const D > constPtrType
Definition: PtrTypes.h:227
zypp::rw_pointer::Scoped::use_count
long use_count(const PtrType &ptr_r) const
Definition: PtrTypes.h:236
zypp::rw_pointer::Scoped::PtrType
scoped_ptr< D > PtrType
Definition: PtrTypes.h:226
zypp::rw_pointer::Scoped::unique
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition: PtrTypes.h:229
zypp::rw_pointer::Scoped::unique
bool unique(const PtrType &ptr_r)
Definition: PtrTypes.h:231
zypp::rw_pointer::Scoped::use_count
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition: PtrTypes.h:234
zypp::rw_pointer::Shared
Definition: PtrTypes.h:191
zypp::rw_pointer::Shared::PtrType
shared_ptr< D > PtrType
Definition: PtrTypes.h:192
zypp::rw_pointer::Shared::constPtrType
shared_ptr< const D > constPtrType
Definition: PtrTypes.h:193
zypp::rw_pointer::Shared::use_count
long use_count(const PtrType &ptr_r) const
Definition: PtrTypes.h:202
zypp::rw_pointer::Shared::use_count
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition: PtrTypes.h:200
zypp::rw_pointer::Shared::unique
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition: PtrTypes.h:195
zypp::rw_pointer::Shared::unique
bool unique(const PtrType &ptr_r)
Definition: PtrTypes.h:197