Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::Ref< T > Class Template Reference

#include <elm/util/Ref.h>

Public Member Functions

 Ref (T *_ptr)
 
 Ref (const Ref< T > &ref)
 
 operator T & (void) const
 
T * operator& (void) const
 
T & operator* (void) const
 
T * operator-> (void) const
 
Ref< T > & operator= (T *_ptr)
 
Ref< T > & operator= (const Ref< T > &ref)
 
Ref< T > & operator= (const T &val)
 

Detailed Description

template<class T>
class elm::Ref< T >

This class allows handling pointer as references but they provide assignment operators.

Parameters
TPointe type.

Constructor & Destructor Documentation

template<class T>
elm::Ref< T >::Ref ( T *  _ptr)

Build a new reference.

Parameters
_ptrPointer to store in.
template<class T>
elm::Ref< T >::Ref ( const Ref< T > &  ref)

Cloning constructor.

Parameters
refCloned reference.

Member Function Documentation

template<class T>
elm::Ref< T >::operator T & ( void  ) const

Automatic conversion to reference.

Returns
Reference on pointed object.
template<class T>
T * elm::Ref< T >::operator& ( void  ) const

Get the stored pointer.

Returns
Stored pointer.
template<class T>
T& elm::Ref< T >::operator* ( void  ) const
template<class T>
T * elm::Ref< T >::operator-> ( void  ) const

Only way to perform unreference with structure and objects.

Returns
Pointer on object.
template<class T>
Ref & elm::Ref< T >::operator= ( T *  _ptr)

Assignment with a pointer.

Parameters
_ptrAssigned pointer.
Returns
Current object.
template<class T>
Ref & elm::Ref< T >::operator= ( const Ref< T > &  ref)

Assignment with a reference.

Parameters
refAssigned reference.
Returns
Current object.
template<class T>
Ref< T > & elm::Ref< T >::operator= ( const T &  val)

Assignment of the pointed value.

Parameters
valAssigned value.
Returns
Current object.

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