ThePEG 2.3.0
|
ConstRCPtr is a reference counted (smart) const pointer. More...
#include <RCPtr.h>
Public Types | |
typedef void | iterator_category |
Template argument typedef. | |
typedef void | difference_type |
Template argument typedef. | |
typedef T * | pointer |
Template argument typedef. | |
typedef const T * | const_pointer |
Template argument typedef. | |
typedef T & | reference |
Template argument typedef. | |
typedef const T & | const_reference |
Template argument typedef. | |
typedef T | value_type |
Template argument typedef. | |
Public Member Functions | |
ConstRCPtr () | |
Constructor for null pointer. | |
ConstRCPtr (decltype(nullptr)) | |
Constructor for nullptr. | |
ConstRCPtr (const ConstRCPtr &p) | |
Copy constructor. | |
template<typename UPtr > | |
ConstRCPtr (const UPtr &u) | |
Copyconstructor for class UPtr which has operator-> defined resulting in a value implicitly convertible to const T *. | |
ConstRCPtr (const_pointer p) | |
Construction from real pointer. | |
~ConstRCPtr () | |
Destructor. | |
ConstRCPtr & | operator= (const ConstRCPtr &p) |
Assignment. | |
template<typename UPtr > | |
ConstRCPtr & | operator= (const UPtr &u) |
Assignment from class UPtr which has operator-> defined resulting in a value implicitly convertible to const T *. | |
template<typename UPtr > | |
ConstRCPtr & | assignDynamic (const UPtr &u) |
Assignment from class UPtr which has operator-> defined resulting in a value which can be cast dynamically to const T *. | |
void | swap (ConstRCPtr &p) |
Make p point to the object pointed to by this and vice versa. | |
bool | operator== (const ConstRCPtr &p) const |
Test for equality of the underlying pointers. | |
bool | operator!= (const ConstRCPtr &p) const |
Test for inequality of the underlying pointers. | |
bool | operator== (const_pointer p) const |
Test for equality of the underlying pointers. | |
bool | operator!= (const_pointer p) const |
Test for inequality of the underlying pointers. | |
template<typename UPtr > | |
bool | operator== (const UPtr &u) const |
Test for equality of the underlying pointers. | |
template<typename UPtr > | |
bool | operator!= (const UPtr &u) const |
Test for inequality of the underlying pointers. | |
bool | operator< (const ConstRCPtr &p) const |
Test for ordering. | |
bool | operator< (const_pointer p) const |
Test for ordering. | |
bool | operator! () const |
Returns true if the underlying pointer is null. | |
operator const T * () const | |
Returns the underlying pointer. | |
const_pointer | operator-> () const |
Member access. | |
const_reference | operator* () const |
Dereferencing. | |
Private Member Functions | |
void | increment () |
Increment the counter of the object pointed to. | |
void | release () |
Stop pointing to the current object and delete it if this was the last pointer to it. | |
Private Attributes | |
const_pointer | ptr |
The actual pointer. | |
Additional Inherited Members | |
Protected Member Functions inherited from ThePEG::Pointer::RCPtrBase | |
void | increment (const ReferenceCounted *rcp) |
Increment the counter of a reference counted object. | |
bool | release (const ReferenceCounted *rcp) |
Decrement the counter of a reference counted object. | |
ConstRCPtr is a reference counted (smart) const pointer.
Objects created using the RCPtr::create() methods will continue living until no RCPtr or ConstRCPtr are pointing to it, at which point it will be deleted.
typedef const T* ThePEG::Pointer::ConstRCPtr< T >::const_pointer |
typedef const T& ThePEG::Pointer::ConstRCPtr< T >::const_reference |
typedef void ThePEG::Pointer::ConstRCPtr< T >::difference_type |
typedef void ThePEG::Pointer::ConstRCPtr< T >::iterator_category |
typedef T* ThePEG::Pointer::ConstRCPtr< T >::pointer |
typedef T& ThePEG::Pointer::ConstRCPtr< T >::reference |
typedef T ThePEG::Pointer::ConstRCPtr< T >::value_type |
|
inline |
|
inline |
|
inline |
Copy constructor.
Definition at line 354 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::increment().
|
inline |
Copyconstructor for class UPtr which has operator-> defined resulting in a value implicitly convertible to const T *.
Definition at line 361 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::increment().
|
inlineexplicit |
Construction from real pointer.
Definition at line 366 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::increment().
|
inline |
Destructor.
Deletes the object pointed to if this is the last pointer to it.
Definition at line 372 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::release().
|
inline |
Assignment from class UPtr which has operator-> defined resulting in a value which can be cast dynamically to const T *.
Definition at line 403 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::increment(), ThePEG::Pointer::ConstRCPtr< T >::ptr, and ThePEG::Pointer::ConstRCPtr< T >::release().
|
inlineprivate |
Increment the counter of the object pointed to.
Definition at line 496 of file RCPtr.h.
References ThePEG::Pointer::RCPtrBase::increment(), and ThePEG::Pointer::ConstRCPtr< T >::ptr.
Referenced by ThePEG::Pointer::ConstRCPtr< T >::assignDynamic(), ThePEG::Pointer::ConstRCPtr< T >::ConstRCPtr(), and ThePEG::Pointer::ConstRCPtr< T >::operator=().
|
inline |
Returns the underlying pointer.
Definition at line 479 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Returns true if the underlying pointer is null.
Definition at line 474 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for inequality of the underlying pointers.
Definition at line 431 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for inequality of the underlying pointers.
Definition at line 453 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for inequality of the underlying pointers.
Definition at line 441 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Dereferencing.
Definition at line 489 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Member access.
Definition at line 484 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for ordering.
Definition at line 458 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for ordering.
Definition at line 466 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Assignment.
Definition at line 377 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::increment(), ThePEG::Pointer::ConstRCPtr< T >::ptr, and ThePEG::Pointer::ConstRCPtr< T >::release().
|
inline |
Assignment from class UPtr which has operator-> defined resulting in a value implicitly convertible to const T *.
Definition at line 390 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::increment(), ThePEG::Pointer::ConstRCPtr< T >::ptr, and ThePEG::Pointer::ConstRCPtr< T >::release().
|
inline |
Test for equality of the underlying pointers.
Definition at line 426 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for equality of the underlying pointers.
Definition at line 447 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inline |
Test for equality of the underlying pointers.
Definition at line 436 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
|
inlineprivate |
Stop pointing to the current object and delete it if this was the last pointer to it.
Definition at line 502 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr, and ThePEG::Pointer::RCPtrBase::release().
Referenced by ThePEG::Pointer::ConstRCPtr< T >::assignDynamic(), ThePEG::Pointer::ConstRCPtr< T >::operator=(), and ThePEG::Pointer::ConstRCPtr< T >::~ConstRCPtr().
|
inline |
Make p point to the object pointed to by this and vice versa.
Definition at line 416 of file RCPtr.h.
References ThePEG::Pointer::ConstRCPtr< T >::ptr.
Referenced by std::swap().
|
private |
The actual pointer.
Definition at line 507 of file RCPtr.h.
Referenced by ThePEG::Pointer::ConstRCPtr< T >::assignDynamic(), ThePEG::Pointer::ConstRCPtr< T >::increment(), ThePEG::Pointer::ConstRCPtr< T >::operator const T *(), ThePEG::Pointer::ConstRCPtr< T >::operator!(), ThePEG::Pointer::ConstRCPtr< T >::operator!=(), ThePEG::Pointer::ConstRCPtr< T >::operator*(), ThePEG::Pointer::ConstRCPtr< T >::operator->(), ThePEG::Pointer::ConstRCPtr< T >::operator<(), ThePEG::Pointer::ConstRCPtr< T >::operator=(), ThePEG::Pointer::ConstRCPtr< T >::operator==(), ThePEG::Pointer::ConstRCPtr< T >::release(), and ThePEG::Pointer::ConstRCPtr< T >::swap().