Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
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

◆ Ref() [1/2]

Ref ( T *  _ptr)
inline

Build a new reference.

Parameters
_ptrPointer to store in.

◆ Ref() [2/2]

Ref ( const Ref< T > &  ref)
inline

Cloning constructor.

Parameters
refCloned reference.

Member Function Documentation

◆ operator T&()

operator T& ( void  ) const
inline

Automatic conversion to reference.

Returns
Reference on pointed object.

◆ operator&()

T * operator& ( void  ) const
inline

Get the stored pointer.

Returns
Stored pointer.

◆ operator*()

T& operator* ( void  ) const
inline

◆ operator->()

T * operator-> ( void  ) const
inline

Only way to perform unreference with structure and objects.

Returns
Pointer on object.

◆ operator=() [1/3]

Ref & operator= ( const Ref< T > &  ref)
inline

Assignment with a reference.

Parameters
refAssigned reference.
Returns
Current object.

References elm::t::ref().

◆ operator=() [2/3]

Ref< T > & operator= ( const T &  val)
inline

Assignment of the pointed value.

Parameters
valAssigned value.
Returns
Current object.

◆ operator=() [3/3]

Ref & operator= ( T *  _ptr)
inline

Assignment with a pointer.

Parameters
_ptrAssigned pointer.
Returns
Current object.

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