thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
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.
 
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.
 
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() [1/5]

template<typename T >
ThePEG::Pointer::ConstRCPtr< T >::ConstRCPtr ( )
inline

Constructor for null pointer.

Definition at line 344 of file RCPtr.h.

◆ ConstRCPtr() [2/5]

template<typename T >
ThePEG::Pointer::ConstRCPtr< T >::ConstRCPtr ( decltype(nullptr)  )
inline

Constructor for nullptr.

Definition at line 349 of file RCPtr.h.

◆ ConstRCPtr() [3/5]

template<typename T >
ThePEG::Pointer::ConstRCPtr< T >::ConstRCPtr ( const ConstRCPtr< T > &  p)
inline

Copy constructor.

Definition at line 354 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::increment().

◆ ConstRCPtr() [4/5]

template<typename T >
template<typename UPtr >
ThePEG::Pointer::ConstRCPtr< T >::ConstRCPtr ( const UPtr &  u)
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().

◆ ConstRCPtr() [5/5]

template<typename T >
ThePEG::Pointer::ConstRCPtr< T >::ConstRCPtr ( const_pointer  p)
inlineexplicit

Construction from real pointer.

Definition at line 366 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::increment().

◆ ~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::ConstRCPtr< T >::release().

Member Function Documentation

◆ assignDynamic()

template<typename T >
template<typename UPtr >
ConstRCPtr & ThePEG::Pointer::ConstRCPtr< T >::assignDynamic ( const UPtr &  u)
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().

◆ increment()

template<typename T >
void ThePEG::Pointer::ConstRCPtr< T >::increment ( )
inlineprivate

◆ operator const T *()

template<typename T >
ThePEG::Pointer::ConstRCPtr< T >::operator const T * ( ) const
inline

Returns the underlying pointer.

Definition at line 479 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator!()

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator! ( ) const
inline

Returns true if the underlying pointer is null.

Definition at line 474 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator!=() [1/3]

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator!= ( const ConstRCPtr< T > &  p) const
inline

Test for inequality of the underlying pointers.

Definition at line 431 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator!=() [2/3]

template<typename T >
template<typename UPtr >
bool ThePEG::Pointer::ConstRCPtr< T >::operator!= ( const UPtr &  u) const
inline

Test for inequality of the underlying pointers.

Definition at line 453 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator!=() [3/3]

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator!= ( const_pointer  p) const
inline

Test for inequality of the underlying pointers.

Definition at line 441 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator*()

template<typename T >
const_reference ThePEG::Pointer::ConstRCPtr< T >::operator* ( ) const
inline

Dereferencing.

Definition at line 489 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator->()

template<typename T >
const_pointer ThePEG::Pointer::ConstRCPtr< T >::operator-> ( ) const
inline

Member access.

Definition at line 484 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator<() [1/2]

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator< ( const ConstRCPtr< T > &  p) const
inline

Test for ordering.

Definition at line 458 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator<() [2/2]

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator< ( const_pointer  p) const
inline

Test for ordering.

Definition at line 466 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator=() [1/2]

template<typename T >
ConstRCPtr & ThePEG::Pointer::ConstRCPtr< T >::operator= ( const ConstRCPtr< T > &  p)
inline

◆ operator=() [2/2]

template<typename T >
template<typename UPtr >
ConstRCPtr & ThePEG::Pointer::ConstRCPtr< T >::operator= ( const UPtr &  u)
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().

◆ operator==() [1/3]

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator== ( const ConstRCPtr< T > &  p) const
inline

Test for equality of the underlying pointers.

Definition at line 426 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator==() [2/3]

template<typename T >
template<typename UPtr >
bool ThePEG::Pointer::ConstRCPtr< T >::operator== ( const UPtr &  u) const
inline

Test for equality of the underlying pointers.

Definition at line 447 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ operator==() [3/3]

template<typename T >
bool ThePEG::Pointer::ConstRCPtr< T >::operator== ( const_pointer  p) const
inline

Test for equality of the underlying pointers.

Definition at line 436 of file RCPtr.h.

References ThePEG::Pointer::ConstRCPtr< T >::ptr.

◆ release()

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

◆ swap()

template<typename T >
void ThePEG::Pointer::ConstRCPtr< T >::swap ( ConstRCPtr< T > &  p)
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().

Member Data Documentation

◆ ptr


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