aimstil  5.0.5
til::ConstPtr< T > Class Template Reference

Smart pointer for constant objects deriving from SmartObject. More...

#include <til/Ptr.h>

Inheritance diagram for til::ConstPtr< T >:
Collaboration diagram for til::ConstPtr< T >:

Public Types

typedef ConstPtr< T > Self
 
typedef T DataType
 

Public Member Functions

 ConstPtr ()
 Default constructor, pointing to NULL. More...
 
 ConstPtr (const ConstPtr< T > &ptr)
 
 ConstPtr (const T *p)
 
template<class U >
 ConstPtr (const U *p)
 
virtual ~ConstPtr ()
 
 operator const T * (void) const
 Convert a ConstPrt into a const T*. More...
 
const T & operator* (void) const
 
const T * operator-> (void) const
 
ConstPtroperator= (const ConstPtr< T > &p)
 
ConstPtroperator= (const T *p)
 Assignement to a pointer. More...
 
bool operator== (const T *p) const
 Checks whether two pointers point to the same object. More...
 
bool operator== (const ConstPtr< T > &p) const
 
bool operator!= (const T *p) const
 Checks whether two pointers do not point to the same object. More...
 
bool operator!= (const ConstPtr< T > &p) const
 

Protected Attributes

T * m_pointer
 

Detailed Description

template<class T>
class til::ConstPtr< T >

Smart pointer for constant objects deriving from SmartObject.

Definition at line 34 of file Ptr.h.

Member Typedef Documentation

◆ DataType

template<class T>
typedef T til::ConstPtr< T >::DataType

Definition at line 40 of file Ptr.h.

◆ Self

template<class T>
typedef ConstPtr<T> til::ConstPtr< T >::Self

Definition at line 39 of file Ptr.h.

Constructor & Destructor Documentation

◆ ConstPtr() [1/4]

template<class T>
til::ConstPtr< T >::ConstPtr ( )
inline

Default constructor, pointing to NULL.

Definition at line 48 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ ConstPtr() [2/4]

template<class T>
til::ConstPtr< T >::ConstPtr ( const ConstPtr< T > &  ptr)
inline

Definition at line 50 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ ConstPtr() [3/4]

template<class T>
til::ConstPtr< T >::ConstPtr ( const T *  p)
inline

Definition at line 60 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ ConstPtr() [4/4]

template<class T>
template<class U >
til::ConstPtr< T >::ConstPtr ( const U *  p)
inline

Definition at line 69 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ ~ConstPtr()

template<class T>
virtual til::ConstPtr< T >::~ConstPtr ( )
inlinevirtual

Definition at line 82 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

Member Function Documentation

◆ operator const T *()

template<class T>
til::ConstPtr< T >::operator const T * ( void  ) const
inline

Convert a ConstPrt into a const T*.

Definition at line 96 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ operator!=() [1/2]

template<class T>
bool til::ConstPtr< T >::operator!= ( const T *  p) const
inline

Checks whether two pointers do not point to the same object.

Definition at line 155 of file Ptr.h.

References til::ConstPtr< T >::operator==().

◆ operator!=() [2/2]

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

Definition at line 156 of file Ptr.h.

References til::ConstPtr< T >::operator==().

◆ operator*()

template<class T>
const T& til::ConstPtr< T >::operator* ( void  ) const
inline

Definition at line 100 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ operator->()

template<class T>
const T* til::ConstPtr< T >::operator-> ( void  ) const
inline

Definition at line 104 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ operator=() [1/2]

template<class T>
ConstPtr& til::ConstPtr< T >::operator= ( const ConstPtr< T > &  p)
inline

Definition at line 107 of file Ptr.h.

◆ operator=() [2/2]

template<class T>
ConstPtr& til::ConstPtr< T >::operator= ( const T *  p)
inline

Assignement to a pointer.

We unsubscribe to the previous object we pointed to, if any. Note that this object will destroy itself if we were the last pointer to point to it (and its lock mode is off). Note that this can therefore be used to free an object before the end of the current block, by setting the pointer to NULL.

Definition at line 118 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

◆ operator==() [1/2]

template<class T>
bool til::ConstPtr< T >::operator== ( const T *  p) const
inline

Checks whether two pointers point to the same object.

Definition at line 151 of file Ptr.h.

References til::ConstPtr< T >::m_pointer.

Referenced by til::ConstPtr< T >::operator!=().

◆ operator==() [2/2]

template<class T>
bool til::ConstPtr< T >::operator== ( const ConstPtr< T > &  p) const
inline

Definition at line 152 of file Ptr.h.

References til::ConstPtr< T >::operator==().

Referenced by til::ConstPtr< T >::operator==().

Member Data Documentation

◆ m_pointer


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