OpenLexocad  27.1
Base::Reference< T > Class Template Reference

#include <Handle.h>

Public Member Functions

 Reference ()
 
 Reference (T *p)
 
 Reference (const Reference< T > &p)
 
 ~Reference ()
 
Reference< T > & operator= (T *p)
 
Reference< T > & operator= (const Reference< T > &p)
 
T & operator * () const
 
T * operator-> () const
 
 operator T * () const
 
bool operator< (const Reference< T > &p) const
 
bool operator== (const Reference< T > &p) const
 
bool operator!= (const Reference< T > &p) const
 
bool isValid (void) const
 Test if it handles something. More...
 
bool isNull (void) const
 Test if it does not handle anything. More...
 
int getRefCount (void) const
 Get number of references on the object, including this one. More...
 

Detailed Description

template<class T>
class Base::Reference< T >

Reference class Implementation of the reference counting pattern. Only able to instantiate with a class inheriting Base::Handled.

Constructor & Destructor Documentation

◆ Reference() [1/3]

template<class T>
Base::Reference< T >::Reference ( )
inline

Pointer and default constructor

◆ Reference() [2/3]

template<class T>
Base::Reference< T >::Reference ( T *  p)
inline

◆ Reference() [3/3]

template<class T>
Base::Reference< T >::Reference ( const Reference< T > &  p)
inline

Copy constructor

◆ ~Reference()

template<class T>
Base::Reference< T >::~Reference ( )
inline

destructor Release the reference counter which causes, in case of the last one, the referenced object to be destructed!

Member Function Documentation

◆ getRefCount()

template<class T>
int Base::Reference< T >::getRefCount ( void  ) const
inline

Get number of references on the object, including this one.

◆ isNull()

template<class T>
bool Base::Reference< T >::isNull ( void  ) const
inline

Test if it does not handle anything.

◆ isValid()

template<class T>
bool Base::Reference< T >::isValid ( void  ) const
inline

Test if it handles something.

◆ operator *()

template<class T>
T& Base::Reference< T >::operator * ( ) const
inline

Dereference operator

◆ operator T *()

template<class T>
Base::Reference< T >::operator T * ( ) const
inline

◆ operator!=()

template<class T>
bool Base::Reference< T >::operator!= ( const Reference< T > &  p) const
inline

◆ operator->()

template<class T>
T* Base::Reference< T >::operator-> ( ) const
inline

Dereference operator

◆ operator<()

template<class T>
bool Base::Reference< T >::operator< ( const Reference< T > &  p) const
inline

Lower operator, needed for sorting in maps and sets

◆ operator=() [1/2]

template<class T>
Reference<T>& Base::Reference< T >::operator= ( T *  p)
inline

Assign operator from a pointer

◆ operator=() [2/2]

template<class T>
Reference<T>& Base::Reference< T >::operator= ( const Reference< T > &  p)
inline

Assign operator from a handle

◆ operator==()

template<class T>
bool Base::Reference< T >::operator== ( const Reference< T > &  p) const
inline

Equal operator


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