libzypp: zypp-core/base/PtrTypes.h Source File

libzypp 17.38.15

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 <zypp-core/Globals.h>
20#include <boost/scoped_ptr.hpp>
21#include <boost/shared_ptr.hpp>
22#include <boost/weak_ptr.hpp>
23#include <boost/intrusive_ptr.hpp>
24
26namespace zypp
27{
28
29 namespace str
30 {
31 // printing void* (prevents us from including <ostream>)
32 std::string form( const char * format, ... ) __attribute__ ((format (printf, 1, 2)));
33 }
34
51
83 struct NullDeleter
84 {
85 void operator()( const void *const ) const
86 {}
87 };
88
90 using boost::scoped_ptr;
91
93 using boost::shared_ptr;
94
96 using boost::weak_ptr;
97
99 using boost::intrusive_ptr;
100
101 template<typename T, typename... Args>
102 inline intrusive_ptr<T>
103 make_intrusive( Args&&... __args ) {
104 return intrusive_ptr<T>( new T( std::forward<Args>(__args)...) );
105 }
106
108 using boost::static_pointer_cast;
110 using boost::const_pointer_cast;
112 using boost::dynamic_pointer_cast;
113
115} // namespace zypp
118namespace std
119{
120
121 // namespace sub {
122 // class Foo;
123 // typedef zypp::intrusive_ptr<Foo> Foo_Ptr; // see DEFINE_PTR_TYPE(NAME) macro below
124 // }
125
126 // Defined in namespace std g++ finds the output operator (König-Lookup),
127 // even if we typedef the pointer in a different namespace than ::zypp.
128 // Otherwise we had to define an output operator always in the same namespace
129 // as the typedef (else g++ will just print the pointer value).
130
132 template<class D>
133 inline std::ostream & operator<<( std::ostream & str, const zypp::shared_ptr<D> & obj )
134 {
135 if ( obj )
136 return str << *obj;
137 return str << std::string("NULL");
138 }
139
140 template<>
141 inline std::ostream & operator<<( std::ostream & str, const zypp::shared_ptr<void> & obj )
142 {
143 if ( obj )
144 return str << zypp::str::form( "%p", static_cast<void*>(obj.get()) );
145 return str << std::string("NULL");
146 }
147
149 template<class D>
150 inline std::ostream & dumpOn( std::ostream & str, const zypp::shared_ptr<D> & obj )
151 {
152 if ( obj )
153 return dumpOn( str, *obj );
154 return str << std::string("NULL");
155 }
156
157 template<>
158 inline std::ostream & dumpOn( std::ostream & str, const zypp::shared_ptr<void> & obj )
159 { return str << obj; }
160
162 template<class D>
163 inline std::ostream & operator<<( std::ostream & str, const zypp::intrusive_ptr<D> & obj )
164 {
165 if ( obj )
166 return str << *obj;
167 return str << std::string("NULL");
168 }
169
170 template<class D>
171 inline std::ostream & dumpOn( std::ostream & str, const zypp::intrusive_ptr<D> & obj )
172 {
173 if ( obj )
174 return dumpOn( str, *obj );
175 return str << std::string("NULL");
176 }
177
178} // namespace std
181namespace zypp
182{
183
185 //
186 // RW_pointer traits
187 //
189
194 namespace rw_pointer {
195
196 template<class D>
197 struct Shared
198 {
199 using PtrType = shared_ptr<D>;
200 using constPtrType = shared_ptr<const D>;
202 bool unique( const constPtrType & ptr_r )
203 { return !ptr_r || ptr_r.unique(); }
204 bool unique( const PtrType & ptr_r )
205 { return !ptr_r || ptr_r.unique(); }
206
207 long use_count( const constPtrType & ptr_r ) const
208 { return ptr_r.use_count(); }
209 long use_count( const PtrType & ptr_r ) const
210 { return ptr_r.use_count(); }
211 };
212
213 template<class D>
214 struct Intrusive
215 {
216 using PtrType = intrusive_ptr<D>;
217 using constPtrType = intrusive_ptr<const D>;
219 bool unique( const constPtrType & ptr_r )
220 { return !ptr_r || (ptr_r->refCount() <= 1); }
221 bool unique( const PtrType & ptr_r )
222 { return !ptr_r || (ptr_r->refCount() <= 1); }
223
224 long use_count( const constPtrType & ptr_r ) const
225 { return ptr_r ? ptr_r->refCount() : 0; }
226 long use_count( const PtrType & ptr_r ) const
227 { return ptr_r ? ptr_r->refCount() : 0; }
228 };
229
230 template<class D>
231 struct Scoped
232 {
233 using PtrType = scoped_ptr<D>;
234 using constPtrType = scoped_ptr<const D>;
236 bool unique( const constPtrType & ptr_r )
237 { return true; }
238 bool unique( const PtrType & ptr_r )
239 { return true; }
240
241 long use_count( const constPtrType & ptr_r ) const
242 { return ptr_r ? 1 : 0; }
243 long use_count( const PtrType & ptr_r ) const
244 { return ptr_r ? 1 : 0; }
245 };
246
247 }
248
249
251 //
252 // CLASS NAME : RW_pointer
253 //
291 template<class D, class DTraits = rw_pointer::Shared<D> >
292 struct RW_pointer
293 {
294 using PtrType = typename DTraits::PtrType;
295 using constPtrType = typename DTraits::constPtrType;
296
297 RW_pointer()
298 {}
299
300 RW_pointer(const RW_pointer &) = default;
301 RW_pointer(RW_pointer &&) = default;
302 RW_pointer &operator=(const RW_pointer &) = default;
303 RW_pointer &operator=(RW_pointer &&) = default;
304 RW_pointer(std::nullptr_t) {}
305
306 explicit
307 RW_pointer( typename PtrType::element_type * dptr )
308 : _dptr( dptr )
309 {}
310
311 explicit
312 RW_pointer( PtrType dptr )
313 : _dptr( dptr )
314 {}
315
316 RW_pointer & operator=( std::nullptr_t )
317 { reset(); return *this; }
318
319 void reset()
320 { PtrType().swap( _dptr ); }
321
322 void reset( typename PtrType::element_type * dptr )
323 { PtrType( dptr ).swap( _dptr ); }
324
325 void swap( RW_pointer & rhs ) noexcept
326 { _dptr.swap( rhs._dptr ); }
327
328 void swap( PtrType & rhs ) noexcept
329 { _dptr.swap( rhs ); }
330
331 explicit operator bool() const
332 { return _dptr.get() != nullptr; }
333
334 const D & operator*() const
335 { return *_dptr; };
336
337 const D * operator->() const
338 { return _dptr.operator->(); }
339
340 const D * get() const
341 { return _dptr.get(); }
342
343 D & operator*()
344 { return *_dptr; }
345
346 D * operator->()
347 { return _dptr.operator->(); }
348
349 D * get()
350 { return _dptr.get(); }
351
352 public:
353 bool unique() const
354 { return DTraits().unique( _dptr ); }
355
356 long use_count() const
357 { return DTraits().use_count( _dptr ); }
358
359 constPtrType getPtr() const
360 { return _dptr; }
361
362 PtrType getPtr()
363 { return _dptr; }
364
365 constPtrType cgetPtr()
366 { return _dptr; }
367
368 private:
369 PtrType _dptr;
370 };
371
372
378 template<class D, class DPtr>
379 inline std::ostream & operator<<( std::ostream & str, const RW_pointer<D, DPtr> & obj )
380 {
381 if ( obj.get() )
382 return str << *obj.get();
383 return str << std::string("NULL");
384 }
385
387 template<class D, class DPtr>
388 inline bool operator==( const RW_pointer<D, DPtr> & lhs, const RW_pointer<D, DPtr> & rhs )
389 { return( lhs.get() == rhs.get() ); }
390
391 template<class D, class DPtr>
392 inline bool operator==( const RW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
393 { return( lhs.get() == rhs.get() ); }
394
395 template<class D, class DPtr>
396 inline bool operator==( const typename DPtr::PtrType & lhs, const RW_pointer<D, DPtr> & rhs )
397 { return( lhs.get() == rhs.get() ); }
398
399 template<class D, class DPtr>
400 inline bool operator==( const RW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
401 { return( lhs.get() == rhs.get() ); }
402
403 template<class D, class DPtr>
404 inline bool operator==( const typename DPtr::constPtrType & lhs, const RW_pointer<D, DPtr> & rhs )
405 { return( lhs.get() == rhs.get() ); }
406
407 template<class D, class DPtr>
408 inline bool operator==( const RW_pointer<D, DPtr> & lhs, std::nullptr_t )
409 { return( lhs.get() == nullptr ); }
410
411 template<class D, class DPtr>
412 inline bool operator==( std::nullptr_t, const RW_pointer<D, DPtr> & rhs )
413 { return( nullptr == rhs.get() ); }
414
415
417 template<class D, class DPtr>
418 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, const RW_pointer<D, DPtr> & rhs )
419 { return ! ( lhs == rhs ); }
420
421 template<class D, class DPtr>
422 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
423 { return ! ( lhs == rhs ); }
424
425 template<class D, class DPtr>
426 inline bool operator!=( const typename DPtr::PtrType & lhs, const RW_pointer<D, DPtr> & rhs )
427 { return ! ( lhs == rhs ); }
428
429 template<class D, class DPtr>
430 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
431 { return ! ( lhs == rhs ); }
432
433 template<class D, class DPtr>
434 inline bool operator!=( const typename DPtr::constPtrType & lhs, const RW_pointer<D, DPtr> & rhs )
435 { return ! ( lhs == rhs ); }
436
437 template<class D, class DPtr>
438 inline bool operator!=( const RW_pointer<D, DPtr> & lhs, std::nullptr_t )
439 { return( lhs.get() != nullptr ); }
440
441 template<class D, class DPtr>
442 inline bool operator!=( std::nullptr_t, const RW_pointer<D, DPtr> & rhs )
443 { return( nullptr != rhs.get() ); }
444
446
452 template<class D>
453 inline D * rwcowClone( const D * rhs )
454 { return rhs->clone(); }
455
457 //
458 // CLASS NAME : RWCOW_pointer
459 //
467 template<class D, class DTraits = rw_pointer::Shared<D> >
468 struct RWCOW_pointer
469 {
470 using PtrType = typename DTraits::PtrType;
471 using constPtrType = typename DTraits::constPtrType;
472
473 RWCOW_pointer() {}
474
475 RWCOW_pointer(std::nullptr_t) {}
476
477 RWCOW_pointer(const RWCOW_pointer &) = default;
478
479 RWCOW_pointer(RWCOW_pointer &&) = default;
480
481 explicit
482 RWCOW_pointer( typename PtrType::element_type * dptr )
483 : _dptr( dptr )
484 {}
485
486 explicit
487 RWCOW_pointer( PtrType dptr )
488 : _dptr( dptr )
489 {}
490
491 RWCOW_pointer & operator=( std::nullptr_t )
492 { reset(); return *this; }
493
494 RWCOW_pointer &operator=(const RWCOW_pointer &) = default;
495
496 RWCOW_pointer &operator=(RWCOW_pointer &&) = default;
497
498 void reset()
499 { PtrType().swap( _dptr ); }
500
501 void reset( typename PtrType::element_type * dptr )
502 { PtrType( dptr ).swap( _dptr ); }
503
504 void swap( RWCOW_pointer & rhs ) noexcept
505 { _dptr.swap( rhs._dptr ); }
506
507 void swap( PtrType & rhs ) noexcept
508 { _dptr.swap( rhs ); }
509
510 explicit operator bool() const
511 { return _dptr.get() != nullptr; }
512
513 const D & operator*() const
514 { return *_dptr; };
515
516 const D * operator->() const
517 { return _dptr.operator->(); }
518
519 const D * get() const
520 { return _dptr.get(); }
521
522 D & operator*()
523 { assertUnshared(); return *_dptr; }
524
525 D * operator->()
526 { assertUnshared(); return _dptr.operator->(); }
527
528 D * get()
529 { assertUnshared(); return _dptr.get(); }
530
531 public:
532 bool unique() const
533 { return DTraits().unique( _dptr ); }
534
535 long use_count() const
536 { return DTraits().use_count( _dptr ); }
537
538 constPtrType getPtr() const
539 { return _dptr; }
540
541 PtrType getPtr()
542 { assertUnshared(); return _dptr; }
543
544 constPtrType cgetPtr()
545 { return _dptr; }
546
547 private:
548
549 void assertUnshared()
550 {
551 if ( !unique() )
552 PtrType( rwcowClone( _dptr.get() ) ).swap( _dptr );
553 }
554
555 private:
556 PtrType _dptr;
557 };
558
559
565 template<class D, class DPtr>
566 inline std::ostream & operator<<( std::ostream & str, const RWCOW_pointer<D, DPtr> & obj )
567 {
568 if ( obj.get() )
569 return str << *obj.get();
570 return str << std::string("NULL");
571 }
572
574 template<class D, class DPtr>
575 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, const RWCOW_pointer<D, DPtr> & rhs )
576 { return( lhs.get() == rhs.get() ); }
577
578 template<class D, class DPtr>
579 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
580 { return( lhs.get() == rhs.get() ); }
581
582 template<class D, class DPtr>
583 inline bool operator==( const typename DPtr::PtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
584 { return( lhs.get() == rhs.get() ); }
585
586 template<class D, class DPtr>
587 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
588 { return( lhs.get() == rhs.get() ); }
589
590 template<class D, class DPtr>
591 inline bool operator==( const typename DPtr::constPtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
592 { return( lhs.get() == rhs.get() ); }
593
594 template<class D, class DPtr>
595 inline bool operator==( const RWCOW_pointer<D, DPtr> & lhs, std::nullptr_t )
596 { return( lhs.get() == nullptr ); }
597
598 template<class D, class DPtr>
599 inline bool operator==( std::nullptr_t, const RWCOW_pointer<D, DPtr> & rhs )
600 { return( nullptr == rhs.get() ); }
601
603 template<class D, class DPtr>
604 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, const RWCOW_pointer<D, DPtr> & rhs )
605 { return ! ( lhs == rhs ); }
606
607 template<class D, class DPtr>
608 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::PtrType & rhs )
609 { return ! ( lhs == rhs ); }
610
611 template<class D, class DPtr>
612 inline bool operator!=( const typename DPtr::PtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
613 { return ! ( lhs == rhs ); }
614
615 template<class D, class DPtr>
616 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, const typename DPtr::constPtrType & rhs )
617 { return ! ( lhs == rhs ); }
618
619 template<class D, class DPtr>
620 inline bool operator!=( const typename DPtr::constPtrType & lhs, const RWCOW_pointer<D, DPtr> & rhs )
621 { return ! ( lhs == rhs ); }
622
623 template<class D, class DPtr>
624 inline bool operator!=( const RWCOW_pointer<D, DPtr> & lhs, std::nullptr_t )
625 { return( lhs.get() != nullptr ); }
626
627 template<class D, class DPtr>
628 inline bool operator!=( std::nullptr_t, const RWCOW_pointer<D, DPtr> & rhs )
629 { return( nullptr != rhs.get() ); }
630
632
635} // namespace zypp
637
639#define DEFINE_PTR_TYPE(NAME) \
640class NAME; \
641extern void intrusive_ptr_add_ref( const NAME * ) ZYPP_API; \
642extern void intrusive_ptr_release( const NAME * ) ZYPP_API; \
643typedef zypp::intrusive_ptr<NAME> NAME##_Ptr; \
644typedef zypp::intrusive_ptr<const NAME> NAME##_constPtr;
645
647#endif // ZYPP_BASE_PTRTYPES_H
Globals.h
Provides API related macros.
bool
intrusive_ptr
scoped_ptr
shared_ptr
std::operator<<
ostream & operator<<(ostream &str, CCC_ &&color_r)
relates: ansi::Color Stream oputput for ColorTraits enabled types Defined in namespace 'std' because ...
Definition ansi.h:860
std::dumpOn
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< D > &obj)
relates: zypp::shared_ptr Stream output.
Definition PtrTypes.h:150
str
String related utilities and Regular expression matching.
zypp::rw_pointer
Don't forgett to provide versions for PtrType and constPtrType, esp.
Definition PtrTypes.h:194
zypp::str
Provide print[f] and sprint[f] functions based on JoinFormat.
Definition PurgeKernels.h:19
zypp::str::printf
Ostream & printf(Ostream &str, Format &&fmt, Args &&... args)
Print Format on stream.
Definition LogTools.h:250
zypp::str::form
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition String.cc:39
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::operator!=
bool operator!=(const Capability &lhs, const Capability &rhs)
relates: Capability
Definition Capability.h:313
zypp::operator==
bool operator==(const Capability &lhs, const Capability &rhs)
relates: Capability
Definition Capability.h:309
zypp::rwcowClone
D * rwcowClone(const D *rhs)
relates: RWCOW_pointer Clone the underlying object.
Definition PtrTypes.h:453
zypp::make_intrusive
intrusive_ptr< T > make_intrusive(Args &&... __args)
Definition PtrTypes.h:103
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition Capabilities.cc:65
zypp::NullDeleter
shared_ptr custom deleter doing nothing.
Definition PtrTypes.h:84
zypp::NullDeleter::operator()
void operator()(const void *const) const
Definition PtrTypes.h:85
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469
zypp::RWCOW_pointer::swap
void swap(PtrType &rhs) noexcept
Definition PtrTypes.h:507
zypp::RWCOW_pointer::operator=
RWCOW_pointer & operator=(std::nullptr_t)
Definition PtrTypes.h:491
zypp::RWCOW_pointer::operator*
const D & operator*() const
Definition PtrTypes.h:513
zypp::RWCOW_pointer::cgetPtr
constPtrType cgetPtr()
Definition PtrTypes.h:544
zypp::RWCOW_pointer::operator=
RWCOW_pointer & operator=(const RWCOW_pointer &)=default
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(RWCOW_pointer &&)=default
zypp::RWCOW_pointer< UrlBase >::reset
void reset()
Definition PtrTypes.h:498
zypp::RWCOW_pointer::operator->
const D * operator->() const
Definition PtrTypes.h:516
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(const RWCOW_pointer &)=default
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer()
Definition PtrTypes.h:473
zypp::RWCOW_pointer::operator*
D & operator*()
Definition PtrTypes.h:522
zypp::RWCOW_pointer::get
const D * get() const
Definition PtrTypes.h:519
zypp::RWCOW_pointer::operator->
D * operator->()
Definition PtrTypes.h:525
zypp::RWCOW_pointer::getPtr
PtrType getPtr()
Definition PtrTypes.h:541
zypp::RWCOW_pointer::get
D * get()
Definition PtrTypes.h:528
zypp::RWCOW_pointer::operator=
RWCOW_pointer & operator=(RWCOW_pointer &&)=default
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(std::nullptr_t)
Definition PtrTypes.h:475
zypp::RWCOW_pointer::getPtr
constPtrType getPtr() const
Definition PtrTypes.h:538
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(PtrType dptr)
Definition PtrTypes.h:487
zypp::RWCOW_pointer::use_count
long use_count() const
Definition PtrTypes.h:535
zypp::RWCOW_pointer::unique
bool unique() const
Definition PtrTypes.h:532
zypp::RWCOW_pointer::RWCOW_pointer
RWCOW_pointer(typename PtrType::element_type *dptr)
Definition PtrTypes.h:482
zypp::RWCOW_pointer::swap
void swap(RWCOW_pointer &rhs) noexcept
Definition PtrTypes.h:504
zypp::RWCOW_pointer::PtrType
typename DTraits::PtrType PtrType
Definition PtrTypes.h:470
zypp::RWCOW_pointer::reset
void reset(typename PtrType::element_type *dptr)
Definition PtrTypes.h:501
zypp::RWCOW_pointer< UrlBase >::assertUnshared
void assertUnshared()
Definition PtrTypes.h:549
zypp::RWCOW_pointer::constPtrType
typename DTraits::constPtrType constPtrType
Definition PtrTypes.h:471
zypp::RWCOW_pointer< UrlBase >::_dptr
PtrType _dptr
Definition PtrTypes.h:556
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
zypp::RW_pointer< MediaVerifierBase >::constPtrType
typename rw_pointer::Shared< MediaVerifierBase >::constPtrType constPtrType
Definition PtrTypes.h:295
zypp::RW_pointer::get
D * get()
Definition PtrTypes.h:349
zypp::RW_pointer::operator->
D * operator->()
Definition PtrTypes.h:346
zypp::RW_pointer::operator*
D & operator*()
Definition PtrTypes.h:343
zypp::RW_pointer::RW_pointer
RW_pointer(std::nullptr_t)
Definition PtrTypes.h:304
zypp::RW_pointer::RW_pointer
RW_pointer(RW_pointer &&)=default
zypp::RW_pointer::swap
void swap(PtrType &rhs) noexcept
Definition PtrTypes.h:328
zypp::RW_pointer::RW_pointer
RW_pointer(typename PtrType::element_type *dptr)
Definition PtrTypes.h:307
zypp::RW_pointer< MediaVerifierBase >::_dptr
PtrType _dptr
Definition PtrTypes.h:369
zypp::RW_pointer::cgetPtr
constPtrType cgetPtr()
Definition PtrTypes.h:365
zypp::RW_pointer::use_count
long use_count() const
Definition PtrTypes.h:356
zypp::RW_pointer< MediaVerifierBase >::reset
void reset()
Definition PtrTypes.h:319
zypp::RW_pointer::operator->
const D * operator->() const
Definition PtrTypes.h:337
zypp::RW_pointer::RW_pointer
RW_pointer()
Definition PtrTypes.h:297
zypp::RW_pointer::reset
void reset(typename PtrType::element_type *dptr)
Definition PtrTypes.h:322
zypp::RW_pointer::RW_pointer
RW_pointer(PtrType dptr)
Definition PtrTypes.h:312
zypp::RW_pointer::operator=
RW_pointer & operator=(const RW_pointer &)=default
zypp::RW_pointer::getPtr
constPtrType getPtr() const
Definition PtrTypes.h:359
zypp::RW_pointer::operator*
const D & operator*() const
Definition PtrTypes.h:334
zypp::RW_pointer::swap
void swap(RW_pointer &rhs) noexcept
Definition PtrTypes.h:325
zypp::RW_pointer::get
const D * get() const
Definition PtrTypes.h:340
zypp::RW_pointer::unique
bool unique() const
Definition PtrTypes.h:353
zypp::RW_pointer< MediaVerifierBase >::PtrType
typename rw_pointer::Shared< MediaVerifierBase >::PtrType PtrType
Definition PtrTypes.h:294
zypp::RW_pointer::RW_pointer
RW_pointer(const RW_pointer &)=default
zypp::RW_pointer::getPtr
PtrType getPtr()
Definition PtrTypes.h:362
zypp::RW_pointer::operator=
RW_pointer & operator=(std::nullptr_t)
Definition PtrTypes.h:316
zypp::RW_pointer::operator=
RW_pointer & operator=(RW_pointer &&)=default
zypp::rw_pointer::Intrusive
Definition PtrTypes.h:215
zypp::rw_pointer::Intrusive::use_count
long use_count(const PtrType &ptr_r) const
Definition PtrTypes.h:226
zypp::rw_pointer::Intrusive::constPtrType
intrusive_ptr< const D > constPtrType
Definition PtrTypes.h:217
zypp::rw_pointer::Intrusive::PtrType
intrusive_ptr< D > PtrType
Definition PtrTypes.h:216
zypp::rw_pointer::Intrusive::use_count
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition PtrTypes.h:224
zypp::rw_pointer::Intrusive::unique
bool unique(const PtrType &ptr_r)
Definition PtrTypes.h:221
zypp::rw_pointer::Intrusive::unique
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition PtrTypes.h:219
zypp::rw_pointer::Scoped
Definition PtrTypes.h:232
zypp::rw_pointer::Scoped::use_count
long use_count(const PtrType &ptr_r) const
Definition PtrTypes.h:243
zypp::rw_pointer::Scoped::PtrType
scoped_ptr< D > PtrType
Definition PtrTypes.h:233
zypp::rw_pointer::Scoped::unique
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition PtrTypes.h:236
zypp::rw_pointer::Scoped::constPtrType
scoped_ptr< const D > constPtrType
Definition PtrTypes.h:234
zypp::rw_pointer::Scoped::unique
bool unique(const PtrType &ptr_r)
Definition PtrTypes.h:238
zypp::rw_pointer::Scoped::use_count
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition PtrTypes.h:241
zypp::rw_pointer::Shared
Definition PtrTypes.h:198
zypp::rw_pointer::Shared::PtrType
shared_ptr< D > PtrType
Definition PtrTypes.h:199
zypp::rw_pointer::Shared::use_count
long use_count(const PtrType &ptr_r) const
Definition PtrTypes.h:209
zypp::rw_pointer::Shared::constPtrType
shared_ptr< const D > constPtrType
Definition PtrTypes.h:200
zypp::rw_pointer::Shared::use_count
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition PtrTypes.h:207
zypp::rw_pointer::Shared::unique
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition PtrTypes.h:202
zypp::rw_pointer::Shared::unique
bool unique(const PtrType &ptr_r)
Definition PtrTypes.h:204