thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
ThePEG::Pointer::ConstRCPtr< T > Class Template Reference

ConstRCPtr is a reference counted (smart) const pointer. More...

#include <RCPtr.h>

Inheritance diagram for ThePEG::Pointer::ConstRCPtr< T >:

Public Types

typedef void iterator_category
 Template argument typedef. More...
 
typedef void difference_type
 Template argument typedef. More...
 
typedef T * pointer
 Template argument typedef. More...
 
typedef const T * const_pointer
 Template argument typedef. More...
 
typedef T & reference
 Template argument typedef. More...
 
typedef const T & const_reference
 Template argument typedef. More...
 
typedef T value_type
 Template argument typedef. More...
 

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. More...
 
ConstRCPtroperator= (const ConstRCPtr &p)
 Assignment.
 
template<typename UPtr >
ConstRCPtroperator= (const UPtr &u)
 Assignment from class UPtr which has operator-> defined resulting in a value implicitly convertible to const T *.
 
template<typename UPtr >
ConstRCPtrassignDynamic (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.
 

Detailed Description

template<typename T>
class ThePEG::Pointer::ConstRCPtr< T >

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.

See also
ReferenceCounted

Definition at line 320 of file RCPtr.h.

Member Typedef Documentation

◆ const_pointer

template<typename T>
typedef const T* ThePEG::Pointer::ConstRCPtr< T >::const_pointer

Template argument typedef.

Definition at line 331 of file RCPtr.h.

◆ const_reference

template<typename T>
typedef const T& ThePEG::Pointer::ConstRCPtr< T >::const_reference

Template argument typedef.

Definition at line 335 of file RCPtr.h.

◆ difference_type

template<typename T>
typedef void ThePEG::Pointer::ConstRCPtr< T >::difference_type

Template argument typedef.

Definition at line 327 of file RCPtr.h.

◆ iterator_category

template<typename T>
typedef void ThePEG::Pointer::ConstRCPtr< T >::iterator_category

Template argument typedef.

Definition at line 325 of file RCPtr.h.

◆ pointer

template<typename T>
typedef T* ThePEG::Pointer::ConstRCPtr< T >::pointer

Template argument typedef.

Definition at line 329 of file RCPtr.h.

◆ reference

template<typename T>
typedef T& ThePEG::Pointer::ConstRCPtr< T >::reference

Template argument typedef.

Definition at line 333 of file RCPtr.h.

◆ value_type

template<typename T>
typedef T ThePEG::Pointer::ConstRCPtr< T >::value_type

Template argument typedef.

Definition at line 337 of file RCPtr.h.

Constructor & Destructor Documentation

◆ ~ConstRCPtr()

template<typename T>
ThePEG::Pointer::ConstRCPtr< T >::~ConstRCPtr ( )
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::RCPtrBase::release().


The documentation for this class was generated from the following file: