libzypp 17.37.17
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
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 }
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 }
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 }
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 }
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 {
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>
215 {
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 {
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> >
293 {
294 using PtrType = typename DTraits::PtrType;
295 using constPtrType = typename DTraits::constPtrType;
296
298 {}
299
300 RW_pointer(const RW_pointer &) = default;
301 RW_pointer(RW_pointer &&) = default;
302 RW_pointer &operator=(const 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
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
344 { return *_dptr; }
345
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
360 { return _dptr; }
361
363 { return _dptr; }
364
366 { return _dptr; }
367
368 private:
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> >
469 {
470 using PtrType = typename DTraits::PtrType;
471 using constPtrType = typename DTraits::constPtrType;
472
474
475 RWCOW_pointer(std::nullptr_t) {}
476
477 RWCOW_pointer(const RWCOW_pointer &) = default;
478
480
481 explicit
482 RWCOW_pointer( typename PtrType::element_type * dptr )
483 : _dptr( dptr )
484 {}
485
486 explicit
488 : _dptr( dptr )
489 {}
490
491 RWCOW_pointer & operator=( std::nullptr_t )
492 { reset(); return *this; }
493
495
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
523 { assertUnshared(); return *_dptr; }
524
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
539 { return _dptr; }
540
542 { assertUnshared(); return _dptr; }
543
545 { return _dptr; }
546
547 private:
548
550 {
551 if ( !unique() )
552 PtrType( rwcowClone( _dptr.get() ) ).swap( _dptr );
553 }
554
555 private:
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
Provides API related macros.
virtual UrlBase * clone() const
Returns pointer to a copy of the current object.
Definition UrlBase.cc:408
Definition ansi.h:855
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition PtrTypes.h:158
std::ostream & operator<<(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition PtrTypes.h:141
String related utilities and Regular expression matching.
Don't forgett to provide versions for PtrType and constPtrType, esp.
Definition PtrTypes.h:194
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition String.cc:39
intrusive_ptr< T > make_intrusive(Args &&... __args)
Definition PtrTypes.h:103
shared_ptr custom deleter doing nothing.
Definition PtrTypes.h:84
void operator()(const void *const) const
Definition PtrTypes.h:85
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:575
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition PtrTypes.h:608
void swap(PtrType &rhs) noexcept
Definition PtrTypes.h:507
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:604
RWCOW_pointer & operator=(std::nullptr_t)
Definition PtrTypes.h:491
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition PtrTypes.h:624
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition PtrTypes.h:579
bool operator==(std::nullptr_t, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:599
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition PtrTypes.h:595
const D & operator*() const
Definition PtrTypes.h:513
constPtrType cgetPtr()
Definition PtrTypes.h:544
RWCOW_pointer & operator=(const RWCOW_pointer &)=default
RWCOW_pointer(RWCOW_pointer &&)=default
bool operator!=(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition PtrTypes.h:616
const D * operator->() const
Definition PtrTypes.h:516
bool operator!=(std::nullptr_t, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:628
RWCOW_pointer(const RWCOW_pointer &)=default
const D * get() const
Definition PtrTypes.h:519
bool operator!=(const typename DPtr::PtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:612
bool operator!=(const typename DPtr::constPtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:620
RWCOW_pointer & operator=(RWCOW_pointer &&)=default
RWCOW_pointer(std::nullptr_t)
Definition PtrTypes.h:475
constPtrType getPtr() const
Definition PtrTypes.h:538
bool operator==(const RWCOW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition PtrTypes.h:587
RWCOW_pointer(PtrType dptr)
Definition PtrTypes.h:487
long use_count() const
Definition PtrTypes.h:535
bool operator==(const typename DPtr::PtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:583
bool unique() const
Definition PtrTypes.h:532
bool operator==(const typename DPtr::constPtrType &lhs, const RWCOW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:591
RWCOW_pointer(typename PtrType::element_type *dptr)
Definition PtrTypes.h:482
void swap(RWCOW_pointer &rhs) noexcept
Definition PtrTypes.h:504
typename DTraits::PtrType PtrType
Definition PtrTypes.h:470
std::ostream & operator<<(std::ostream &str, const RWCOW_pointer< D, DPtr > &obj)
Stream output.
Definition PtrTypes.h:566
D * rwcowClone(const D *rhs)
Clone the underlying object.
Definition PtrTypes.h:453
void reset(typename PtrType::element_type *dptr)
Definition PtrTypes.h:501
typename DTraits::constPtrType constPtrType
Definition PtrTypes.h:471
typename rw_pointer::Shared< MediaVerifierBase >::constPtrType constPtrType
Definition PtrTypes.h:295
bool operator!=(const RW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition PtrTypes.h:438
bool operator!=(const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition PtrTypes.h:422
RW_pointer(std::nullptr_t)
Definition PtrTypes.h:304
bool operator==(const RW_pointer< D, DPtr > &lhs, std::nullptr_t)
Definition PtrTypes.h:408
RW_pointer(RW_pointer &&)=default
void swap(PtrType &rhs) noexcept
Definition PtrTypes.h:328
RW_pointer(typename PtrType::element_type *dptr)
Definition PtrTypes.h:307
std::ostream & operator<<(std::ostream &str, const RW_pointer< D, DPtr > &obj)
Stream output.
Definition PtrTypes.h:379
bool operator==(const RW_pointer< D, DPtr > &lhs, const typename DPtr::PtrType &rhs)
Definition PtrTypes.h:392
constPtrType cgetPtr()
Definition PtrTypes.h:365
long use_count() const
Definition PtrTypes.h:356
bool operator!=(const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:426
bool operator!=(const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:434
const D * operator->() const
Definition PtrTypes.h:337
void reset(typename PtrType::element_type *dptr)
Definition PtrTypes.h:322
bool operator!=(const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition PtrTypes.h:430
RW_pointer(PtrType dptr)
Definition PtrTypes.h:312
RW_pointer & operator=(const RW_pointer &)=default
constPtrType getPtr() const
Definition PtrTypes.h:359
bool operator==(const RW_pointer< D, DPtr > &lhs, const typename DPtr::constPtrType &rhs)
Definition PtrTypes.h:400
bool operator==(std::nullptr_t, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:412
bool operator!=(std::nullptr_t, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:442
const D & operator*() const
Definition PtrTypes.h:334
void swap(RW_pointer &rhs) noexcept
Definition PtrTypes.h:325
const D * get() const
Definition PtrTypes.h:340
bool unique() const
Definition PtrTypes.h:353
typename rw_pointer::Shared< MediaVerifierBase >::PtrType PtrType
Definition PtrTypes.h:294
RW_pointer(const RW_pointer &)=default
bool operator==(const typename DPtr::PtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:396
PtrType getPtr()
Definition PtrTypes.h:362
bool operator==(const typename DPtr::constPtrType &lhs, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:404
RW_pointer & operator=(std::nullptr_t)
Definition PtrTypes.h:316
bool operator!=(const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:418
RW_pointer & operator=(RW_pointer &&)=default
bool operator==(const RW_pointer< D, DPtr > &lhs, const RW_pointer< D, DPtr > &rhs)
Definition PtrTypes.h:388
long use_count(const PtrType &ptr_r) const
Definition PtrTypes.h:226
intrusive_ptr< const D > constPtrType
Definition PtrTypes.h:217
intrusive_ptr< D > PtrType
Definition PtrTypes.h:216
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition PtrTypes.h:224
bool unique(const PtrType &ptr_r)
Definition PtrTypes.h:221
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition PtrTypes.h:219
long use_count(const PtrType &ptr_r) const
Definition PtrTypes.h:243
scoped_ptr< D > PtrType
Definition PtrTypes.h:233
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition PtrTypes.h:236
scoped_ptr< const D > constPtrType
Definition PtrTypes.h:234
bool unique(const PtrType &ptr_r)
Definition PtrTypes.h:238
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition PtrTypes.h:241
shared_ptr< D > PtrType
Definition PtrTypes.h:199
long use_count(const PtrType &ptr_r) const
Definition PtrTypes.h:209
shared_ptr< const D > constPtrType
Definition PtrTypes.h:200
long use_count(const constPtrType &ptr_r) const
Return number of references.
Definition PtrTypes.h:207
bool unique(const constPtrType &ptr_r)
Check whether pointer is not shared.
Definition PtrTypes.h:202
bool unique(const PtrType &ptr_r)
Definition PtrTypes.h:204