libzypp  14.48.5
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> _Ptr;
193  typedef shared_ptr<const _D> _constPtr;
195  bool unique( const _constPtr & ptr_r )
196  { return !ptr_r || ptr_r.unique(); }
197  bool unique( const _Ptr & ptr_r )
198  { return !ptr_r || ptr_r.unique(); }
200  long use_count( const _constPtr & ptr_r ) const
201  { return ptr_r.use_count(); }
202  long use_count( const _Ptr & ptr_r ) const
203  { return ptr_r.use_count(); }
204  };
205 
206  template<class _D>
207  struct Intrusive
208  {
209  typedef intrusive_ptr<_D> _Ptr;
210  typedef intrusive_ptr<const _D> _constPtr;
212  bool unique( const _constPtr & ptr_r )
213  { return !ptr_r || (ptr_r->refCount() <= 1); }
214  bool unique( const _Ptr & ptr_r )
215  { return !ptr_r || (ptr_r->refCount() <= 1); }
217  long use_count( const _constPtr & ptr_r ) const
218  { return ptr_r ? ptr_r->refCount() : 0; }
219  long use_count( const _Ptr & 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> _Ptr;
227  typedef scoped_ptr<const _D> _constPtr;
229  bool unique( const _constPtr & ptr_r )
230  { return true; }
231  bool unique( const _Ptr & ptr_r )
232  { return true; }
234  long use_count( const _constPtr & ptr_r ) const
235  { return ptr_r ? 1 : 0; }
236  long use_count( const _Ptr & 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 _Traits = rw_pointer::Shared<_D> >
285  struct RW_pointer
286  {
287  typedef typename _Traits::_Ptr _Ptr;
288  typedef typename _Traits::_constPtr _constPtr;
289 
291  {}
292 
293  RW_pointer( std::nullptr_t )
294  {}
295 
296  explicit
297  RW_pointer( typename _Ptr::element_type * dptr )
298  : _dptr( dptr )
299  {}
300 
301  explicit
302  RW_pointer( _Ptr dptr )
303  : _dptr( dptr )
304  {}
305 
306  RW_pointer & operator=( std::nullptr_t )
307  { reset(); return *this; }
308 
309  void reset()
310  { _Ptr().swap( _dptr ); }
311 
312  void reset( typename _Ptr::element_type * dptr )
313  { _Ptr( dptr ).swap( _dptr ); }
314 
315  void swap( RW_pointer & rhs )
316  { _dptr.swap( rhs._dptr ); }
317 
318  void swap( _Ptr & 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 _Traits().unique( _dptr ); }
345 
346  long use_count() const
347  { return _Traits().use_count( _dptr ); }
348 
350  { return _dptr; }
351 
353  { return _dptr; }
354 
356  { return _dptr; }
357 
358  private:
360  };
362 
368  template<class _D, class _Ptr>
369  inline std::ostream & operator<<( std::ostream & str, const RW_pointer<_D, _Ptr> & obj )
370  {
371  if ( obj.get() )
372  return str << *obj.get();
373  return str << std::string("NULL");
374  }
375 
377  template<class _D, class _Ptr>
378  inline bool operator==( const RW_pointer<_D, _Ptr> & lhs, const RW_pointer<_D, _Ptr> & rhs )
379  { return( lhs.get() == rhs.get() ); }
381  template<class _D, class _Ptr>
382  inline bool operator==( const RW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_Ptr & rhs )
383  { return( lhs.get() == rhs.get() ); }
385  template<class _D, class _Ptr>
386  inline bool operator==( const typename _Ptr::_Ptr & lhs, const RW_pointer<_D, _Ptr> & rhs )
387  { return( lhs.get() == rhs.get() ); }
389  template<class _D, class _Ptr>
390  inline bool operator==( const RW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_constPtr & rhs )
391  { return( lhs.get() == rhs.get() ); }
393  template<class _D, class _Ptr>
394  inline bool operator==( const typename _Ptr::_constPtr & lhs, const RW_pointer<_D, _Ptr> & rhs )
395  { return( lhs.get() == rhs.get() ); }
397  template<class _D, class _Ptr>
398  inline bool operator==( const RW_pointer<_D, _Ptr> & lhs, std::nullptr_t )
399  { return( lhs.get() == nullptr ); }
401  template<class _D, class _Ptr>
402  inline bool operator==( std::nullptr_t, const RW_pointer<_D, _Ptr> & rhs )
403  { return( nullptr == rhs.get() ); }
404 
405 
407  template<class _D, class _Ptr>
408  inline bool operator!=( const RW_pointer<_D, _Ptr> & lhs, const RW_pointer<_D, _Ptr> & rhs )
409  { return ! ( lhs == rhs ); }
411  template<class _D, class _Ptr>
412  inline bool operator!=( const RW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_Ptr & rhs )
413  { return ! ( lhs == rhs ); }
415  template<class _D, class _Ptr>
416  inline bool operator!=( const typename _Ptr::_Ptr & lhs, const RW_pointer<_D, _Ptr> & rhs )
417  { return ! ( lhs == rhs ); }
419  template<class _D, class _Ptr>
420  inline bool operator!=( const RW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_constPtr & rhs )
421  { return ! ( lhs == rhs ); }
423  template<class _D, class _Ptr>
424  inline bool operator!=( const typename _Ptr::_constPtr & lhs, const RW_pointer<_D, _Ptr> & rhs )
425  { return ! ( lhs == rhs ); }
427  template<class _D, class _Ptr>
428  inline bool operator!=( const RW_pointer<_D, _Ptr> & lhs, std::nullptr_t )
429  { return( lhs.get() != nullptr ); }
431  template<class _D, class _Ptr>
432  inline bool operator!=( std::nullptr_t, const RW_pointer<_D, _Ptr> & 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 _Traits = rw_pointer::Shared<_D> >
459  {
460  typedef typename _Traits::_Ptr _Ptr;
461  typedef typename _Traits::_constPtr _constPtr;
462 
464  {}
465 
466  RWCOW_pointer( std::nullptr_t )
467  {}
468 
469  explicit
470  RWCOW_pointer( typename _Ptr::element_type * dptr )
471  : _dptr( dptr )
472  {}
473 
474  explicit
476  : _dptr( dptr )
477  {}
478 
479  RWCOW_pointer & operator=( std::nullptr_t )
480  { reset(); return *this; }
481 
482  void reset()
483  { _Ptr().swap( _dptr ); }
484 
485  void reset( typename _Ptr::element_type * dptr )
486  { _Ptr( dptr ).swap( _dptr ); }
487 
488  void swap( RWCOW_pointer & rhs )
489  { _dptr.swap( rhs._dptr ); }
490 
491  void swap( _Ptr & 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 _Traits().unique( _dptr ); }
518 
519  long use_count() const
520  { return _Traits().use_count( _dptr ); }
521 
523  { return _dptr; }
524 
526  { assertUnshared(); return _dptr; }
527 
529  { return _dptr; }
530 
531  private:
532 
534  {
535  if ( !unique() )
536  _Ptr( rwcowClone( _dptr.get() ) ).swap( _dptr );
537  }
538 
539  private:
541  };
543 
549  template<class _D, class _Ptr>
550  inline std::ostream & operator<<( std::ostream & str, const RWCOW_pointer<_D, _Ptr> & obj )
551  {
552  if ( obj.get() )
553  return str << *obj.get();
554  return str << std::string("NULL");
555  }
556 
558  template<class _D, class _Ptr>
559  inline bool operator==( const RWCOW_pointer<_D, _Ptr> & lhs, const RWCOW_pointer<_D, _Ptr> & rhs )
560  { return( lhs.get() == rhs.get() ); }
562  template<class _D, class _Ptr>
563  inline bool operator==( const RWCOW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_Ptr & rhs )
564  { return( lhs.get() == rhs.get() ); }
566  template<class _D, class _Ptr>
567  inline bool operator==( const typename _Ptr::_Ptr & lhs, const RWCOW_pointer<_D, _Ptr> & rhs )
568  { return( lhs.get() == rhs.get() ); }
570  template<class _D, class _Ptr>
571  inline bool operator==( const RWCOW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_constPtr & rhs )
572  { return( lhs.get() == rhs.get() ); }
574  template<class _D, class _Ptr>
575  inline bool operator==( const typename _Ptr::_constPtr & lhs, const RWCOW_pointer<_D, _Ptr> & rhs )
576  { return( lhs.get() == rhs.get() ); }
578  template<class _D, class _Ptr>
579  inline bool operator==( const RWCOW_pointer<_D, _Ptr> & lhs, std::nullptr_t )
580  { return( lhs.get() == nullptr ); }
582  template<class _D, class _Ptr>
583  inline bool operator==( std::nullptr_t, const RWCOW_pointer<_D, _Ptr> & rhs )
584  { return( nullptr == rhs.get() ); }
585 
587  template<class _D, class _Ptr>
588  inline bool operator!=( const RWCOW_pointer<_D, _Ptr> & lhs, const RWCOW_pointer<_D, _Ptr> & rhs )
589  { return ! ( lhs == rhs ); }
591  template<class _D, class _Ptr>
592  inline bool operator!=( const RWCOW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_Ptr & rhs )
593  { return ! ( lhs == rhs ); }
595  template<class _D, class _Ptr>
596  inline bool operator!=( const typename _Ptr::_Ptr & lhs, const RWCOW_pointer<_D, _Ptr> & rhs )
597  { return ! ( lhs == rhs ); }
599  template<class _D, class _Ptr>
600  inline bool operator!=( const RWCOW_pointer<_D, _Ptr> & lhs, const typename _Ptr::_constPtr & rhs )
601  { return ! ( lhs == rhs ); }
603  template<class _D, class _Ptr>
604  inline bool operator!=( const typename _Ptr::_constPtr & lhs, const RWCOW_pointer<_D, _Ptr> & rhs )
605  { return ! ( lhs == rhs ); }
607  template<class _D, class _Ptr>
608  inline bool operator!=( const RWCOW_pointer<_D, _Ptr> & lhs, std::nullptr_t )
609  { return( lhs.get() != nullptr ); }
611  template<class _D, class _Ptr>
612  inline bool operator!=( std::nullptr_t, const RWCOW_pointer<_D, _Ptr> & rhs )
613  { return( nullptr != rhs.get() ); }
614 
616 
618 } // 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
bool operator!=(const RW_pointer< _D, _Ptr > &lhs, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:408
bool operator!=(const RWCOW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_Ptr &rhs)
Definition: PtrTypes.h:592
long use_count() const
Definition: PtrTypes.h:519
bool operator!=(const RWCOW_pointer< _D, _Ptr > &lhs, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:588
bool operator==(const RW_pointer< _D, _Ptr > &lhs, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:378
_Traits::_Ptr _Ptr
Definition: PtrTypes.h:460
_constPtr getPtr() const
Definition: PtrTypes.h:522
bool unique(const _Ptr &ptr_r)
Definition: PtrTypes.h:231
RWCOW_pointer & operator=(std::nullptr_t)
Definition: PtrTypes.h:479
bool operator==(const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_constPtr &rhs)
Definition: PtrTypes.h:390
bool operator!=(const typename _Ptr::_constPtr &lhs, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:424
bool operator==(const RWCOW_pointer< _D, _Ptr > &lhs, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:559
bool operator==(const typename _Ptr::_constPtr &lhs, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:394
long use_count(const _constPtr &ptr_r) const
Return number of references.
Definition: PtrTypes.h:234
void swap(_Ptr &rhs)
Definition: PtrTypes.h:491
bool operator!=(const typename _Ptr::_Ptr &lhs, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:416
long use_count() const
Definition: PtrTypes.h:346
const _D & operator*() const
Definition: PtrTypes.h:324
RW_pointer(std::nullptr_t)
Definition: PtrTypes.h:293
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition: PtrTypes.h:151
bool unique(const _constPtr &ptr_r)
Check whether pointer is not shared.
Definition: PtrTypes.h:229
bool operator==(const typename _Ptr::_Ptr &lhs, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:386
bool unique(const _constPtr &ptr_r)
Check whether pointer is not shared.
Definition: PtrTypes.h:212
bool operator!=(const RW_pointer< _D, _Ptr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:428
_constPtr getPtr() const
Definition: PtrTypes.h:349
RW_pointer(_Ptr dptr)
Definition: PtrTypes.h:302
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:36
void reset(typename _Ptr::element_type *dptr)
Definition: PtrTypes.h:485
void reset(typename _Ptr::element_type *dptr)
Definition: PtrTypes.h:312
bool operator==(const RWCOW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_constPtr &rhs)
Definition: PtrTypes.h:571
void swap(_Ptr &rhs)
Definition: PtrTypes.h:318
intrusive_ptr< _D > _Ptr
Definition: PtrTypes.h:209
const _D * get() const
Definition: PtrTypes.h:503
_Traits::_constPtr _constPtr
Definition: PtrTypes.h:461
RW_pointer & operator=(std::nullptr_t)
Definition: PtrTypes.h:306
_Traits::_Ptr _Ptr
Definition: PtrTypes.h:287
RW_pointer(typename _Ptr::element_type *dptr)
Definition: PtrTypes.h:297
bool unique() const
Definition: PtrTypes.h:516
bool operator==(std::nullptr_t, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:583
bool operator!=(const RWCOW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_constPtr &rhs)
Definition: PtrTypes.h:600
bool unique(const _Ptr &ptr_r)
Definition: PtrTypes.h:197
bool unique(const _constPtr &ptr_r)
Check whether pointer is not shared.
Definition: PtrTypes.h:195
long use_count(const _Ptr &ptr_r) const
Definition: PtrTypes.h:219
#define nullptr
Definition: Easy.h:54
bool operator!=(const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_constPtr &rhs)
Definition: PtrTypes.h:420
void assertUnshared()
Definition: PtrTypes.h:533
bool operator==(const typename _Ptr::_Ptr &lhs, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:567
_constPtr cgetPtr()
Definition: PtrTypes.h:528
bool operator!=(std::nullptr_t, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:432
long use_count(const _constPtr &ptr_r) const
Return number of references.
Definition: PtrTypes.h:200
shared_ptr< const _D > _constPtr
Definition: PtrTypes.h:193
bool unique() const
Definition: PtrTypes.h:343
const _D & operator*() const
Definition: PtrTypes.h:497
RWCOW_pointer(std::nullptr_t)
Definition: PtrTypes.h:466
scoped_ptr< _D > _Ptr
Definition: PtrTypes.h:226
bool operator==(const typename _Ptr::_constPtr &lhs, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:575
bool operator!=(const typename _Ptr::_constPtr &lhs, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:604
shared_ptr custom deleter doing nothing.
Definition: PtrTypes.h:82
const _D * get() const
Definition: PtrTypes.h:330
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:285
bool operator==(const RWCOW_pointer< _D, _Ptr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:579
void swap(RW_pointer &rhs)
Definition: PtrTypes.h:315
bool operator!=(const RWCOW_pointer< _D, _Ptr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:608
long use_count(const _Ptr &ptr_r) const
Definition: PtrTypes.h:236
void swap(RWCOW_pointer &rhs)
Definition: PtrTypes.h:488
scoped_ptr< const _D > _constPtr
Definition: PtrTypes.h:227
_Traits::_constPtr _constPtr
Definition: PtrTypes.h:288
const _D * operator->() const
Definition: PtrTypes.h:500
bool operator!=(const typename _Ptr::_Ptr &lhs, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:596
long use_count(const _Ptr &ptr_r) const
Definition: PtrTypes.h:202
shared_ptr< _D > _Ptr
Definition: PtrTypes.h:192
const _D * operator->() const
Definition: PtrTypes.h:327
_D * operator->()
Definition: PtrTypes.h:336
intrusive_ptr< const _D > _constPtr
Definition: PtrTypes.h:210
bool operator!=(const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_Ptr &rhs)
Definition: PtrTypes.h:412
bool operator==(const RW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_Ptr &rhs)
Definition: PtrTypes.h:382
_constPtr cgetPtr()
Definition: PtrTypes.h:355
bool unique(const _Ptr &ptr_r)
Definition: PtrTypes.h:214
long use_count(const _constPtr &ptr_r) const
Return number of references.
Definition: PtrTypes.h:217
bool operator==(std::nullptr_t, const RW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:402
bool operator!=(std::nullptr_t, const RWCOW_pointer< _D, _Ptr > &rhs)
Definition: PtrTypes.h:612
bool operator==(const RW_pointer< _D, _Ptr > &lhs, std::nullptr_t)
Definition: PtrTypes.h:398
_D * rwcowClone(const _D *rhs)
Definition: PtrTypes.h:443
RWCOW_pointer(_Ptr dptr)
Definition: PtrTypes.h:475
bool operator==(const RWCOW_pointer< _D, _Ptr > &lhs, const typename _Ptr::_Ptr &rhs)
Definition: PtrTypes.h:563
_D & operator*()
Definition: PtrTypes.h:333
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:458
RWCOW_pointer(typename _Ptr::element_type *dptr)
Definition: PtrTypes.h:470
void operator()(const void *const ) const
Definition: PtrTypes.h:84