utilmm::smart::pointer< Manager > Class Template Reference
[Smart pointers]

Generic smart pointer. More...

#include <pointer.hh>

List of all members.

Public Types

typedef Manager::base_type base_type
 Pointed type.
typedef Manager::base_type base_type
 Pointed type.
typedef base_typepointer_type
 basic pointer type
typedef base_typepointer_type
 basic pointer type
typedef base_typereference_type
 Basic reference type.
typedef base_typereference_type
 Basic reference type.

Public Member Functions

bool null () const
 Check if null.
bool null () const
 Check if null.
bool operator! () const
 Check if null.
bool operator! () const
 Check if null.
bool operator!= (pointer const &other) const
 Difference test.
bool operator!= (pointer const &other) const
 Difference test.
reference_type operator* () const
 dereference operator
reference_type operator* () const
 dereference operator
pointer_type operator-> () const
 Access operator.
pointer_type operator-> () const
 Access operator.
pointeroperator= (pointer const &other)
 Assignement operator.
pointeroperator= (pointer const &other)
 Assignement operator.
bool operator== (pointer const &other) const
 Equality test.
bool operator== (pointer const &other) const
 Equality test.
 pointer (pointer const &other)
 Copy constructor.
 pointer (pointer_type ptr=0)
 Constructor.
 pointer (pointer const &other)
 Copy constructor.
 pointer (pointer_type ptr=0)
 Constructor.
void reset (pointer_type ptr=0)
 Checnging pointed value.
void reset (pointer_type ptr=0)
 Checnging pointed value.
void swap (pointer &other)
 pointed cell exchange
void swap (pointer &other)
 pointed cell exchange
 ~pointer ()
 Destructor.
 ~pointer ()
 Destructor.

Private Attributes

singleton::use< Manager > manager
Manager::mem_cell pointee

Detailed Description

template<class Manager>
class utilmm::smart::pointer< Manager >

Generic smart pointer.

This class is a generic definition of smart pointer. It uses a memory manager to manage the pointers.

Parameters:
Manager The memory manager
Note:
Manager is used as a singleton using the s
Author:
Frédéric Py <fpy@laas.fr>

Definition at line 52 of file install/include/utilmm/smart/pointer.hh.


Member Typedef Documentation

template<class Manager>
typedef Manager::base_type utilmm::smart::pointer< Manager >::base_type

Pointed type.

This is the type of the element pointed by this pointer

Definition at line 61 of file utilmm/smart/pointer.hh.

template<class Manager>
typedef Manager::base_type utilmm::smart::pointer< Manager >::base_type

Pointed type.

This is the type of the element pointed by this pointer

Definition at line 61 of file install/include/utilmm/smart/pointer.hh.

template<class Manager>
typedef base_type* utilmm::smart::pointer< Manager >::pointer_type

basic pointer type

This is the type of the classical C/C++ pointer for base_type

Definition at line 67 of file utilmm/smart/pointer.hh.

template<class Manager>
typedef base_type* utilmm::smart::pointer< Manager >::pointer_type

basic pointer type

This is the type of the classical C/C++ pointer for base_type

Definition at line 67 of file install/include/utilmm/smart/pointer.hh.

template<class Manager>
typedef base_type& utilmm::smart::pointer< Manager >::reference_type

Basic reference type.

This is the type of the classical C++ reference for base_type

Definition at line 73 of file utilmm/smart/pointer.hh.

template<class Manager>
typedef base_type& utilmm::smart::pointer< Manager >::reference_type

Basic reference type.

This is the type of the classical C++ reference for base_type

Definition at line 73 of file install/include/utilmm/smart/pointer.hh.


Constructor & Destructor Documentation

template<class Manager>
utilmm::smart::pointer< Manager >::pointer ( pointer_type  ptr = 0  )  [explicit]

Constructor.

Parameters:
ptr The basic pointer we want to manage

Create a new instance managing ptr

Warning:
ptr is now managed by the pointer manager. Its life time is controlled by this manager an user must not interfere with it (do not manipulate ptr changing its pointed value or deleting it !!!!
template<class Manager>
utilmm::smart::pointer< Manager >::pointer ( pointer< Manager > const &  other  ) 

Copy constructor.

Parameters:
other The instance to copy.

Create a new instance pôinting to the same cell as other.

This will probably influence the life time of the pointed cell

template<class Manager>
utilmm::smart::pointer< Manager >::~pointer (  ) 

Destructor.

This destructor informs the manager that the smart pointer does not use enymore the stored pointer. It may have probably a strong influence on the pointed cell life time.

template<class Manager>
utilmm::smart::pointer< Manager >::pointer ( pointer_type  ptr = 0  )  [explicit]

Constructor.

Parameters:
ptr The basic pointer we want to manage

Create a new instance managing ptr

Warning:
ptr is now managed by the pointer manager. Its life time is controlled by this manager an user must not interfere with it (do not manipulate ptr changing its pointed value or deleting it !!!!
template<class Manager>
utilmm::smart::pointer< Manager >::pointer ( pointer< Manager > const &  other  ) 

Copy constructor.

Parameters:
other The instance to copy.

Create a new instance pôinting to the same cell as other.

This will probably influence the life time of the pointed cell

template<class Manager>
utilmm::smart::pointer< Manager >::~pointer (  ) 

Destructor.

This destructor informs the manager that the smart pointer does not use enymore the stored pointer. It may have probably a strong influence on the pointed cell life time.


Member Function Documentation

template<class Manager>
bool utilmm::smart::pointer< Manager >::null (  )  const

Check if null.

Return values:
true if current insatnce is pointing to nothing
false else
See also:
operator!()
template<class Manager>
bool utilmm::smart::pointer< Manager >::null (  )  const

Check if null.

Return values:
true if current insatnce is pointing to nothing
false else
See also:
operator!()
template<class Manager>
bool utilmm::smart::pointer< Manager >::operator! (  )  const

Check if null.

Return values:
true if current insatnce is pointing to nothing
false else
See also:
null()
template<class Manager>
bool utilmm::smart::pointer< Manager >::operator! (  )  const

Check if null.

Return values:
true if current insatnce is pointing to nothing
false else
See also:
null()
template<class Manager>
bool utilmm::smart::pointer< Manager >::operator!= ( pointer< Manager > const &  other  )  const

Difference test.

Parameters:
other The instance to compare
Returns:
!operator==(other)
See also:
operator==
template<class Manager>
bool utilmm::smart::pointer< Manager >::operator!= ( pointer< Manager > const &  other  )  const

Difference test.

Parameters:
other The instance to compare
Returns:
!operator==(other)
See also:
operator==
template<class Manager>
reference_type utilmm::smart::pointer< Manager >::operator* (  )  const

dereference operator

Returns:
A reference to the pointed cell
Exceptions:
utilmm::null_access This insatnce points to nothing
See also:
operator->()
template<class Manager>
reference_type utilmm::smart::pointer< Manager >::operator* (  )  const

dereference operator

Returns:
A reference to the pointed cell
Exceptions:
utilmm::null_access This insatnce points to nothing
See also:
operator->()
template<class Manager>
pointer_type utilmm::smart::pointer< Manager >::operator-> (  )  const

Access operator.

Thsi operator gives direct access to the attributes of pointed value

Exceptions:
utilmm::null_access This insatnce points to nothing
See also:
operator*()
template<class Manager>
pointer_type utilmm::smart::pointer< Manager >::operator-> (  )  const

Access operator.

Thsi operator gives direct access to the attributes of pointed value

Exceptions:
utilmm::null_access This insatnce points to nothing
See also:
operator*()
template<class Manager>
pointer& utilmm::smart::pointer< Manager >::operator= ( pointer< Manager > const &  other  ) 

Assignement operator.

Parameters:
other The instance to assign

Change the value of current instance to a value pointing to the same cell as toher.

See also:
reset
template<class Manager>
pointer& utilmm::smart::pointer< Manager >::operator= ( pointer< Manager > const &  other  ) 

Assignement operator.

Parameters:
other The instance to assign

Change the value of current instance to a value pointing to the same cell as toher.

See also:
reset
template<class Manager>
bool utilmm::smart::pointer< Manager >::operator== ( pointer< Manager > const &  other  )  const

Equality test.

Parameters:
other The instance to compare
Return values:
true If current insatnce points to the samme cell as other
false else
See also:
operator!=
template<class Manager>
bool utilmm::smart::pointer< Manager >::operator== ( pointer< Manager > const &  other  )  const

Equality test.

Parameters:
other The instance to compare
Return values:
true If current insatnce points to the samme cell as other
false else
See also:
operator!=
template<class Manager>
void utilmm::smart::pointer< Manager >::reset ( pointer_type  ptr = 0  ) 

Checnging pointed value.

Parameters:
ptr The new pointer to manage

This function release the old pointed value (ie it informa the manager that this instnace no more use the pointed value) and sets the new pointed value to ptr.

Warning:
ptr is now managed by the pointer manager. Its life time is controlled by this manager an user must not interfere with it (do not manipulate ptr changing its pointed value or deleting it !!!!
Note:
This function informs the manager that this insatnce does not use enymore the previously stored pointer. It may have probably a strong influence on the pointed cell life time.
template<class Manager>
void utilmm::smart::pointer< Manager >::reset ( pointer_type  ptr = 0  ) 

Checnging pointed value.

Parameters:
ptr The new pointer to manage

This function release the old pointed value (ie it informa the manager that this instnace no more use the pointed value) and sets the new pointed value to ptr.

Warning:
ptr is now managed by the pointer manager. Its life time is controlled by this manager an user must not interfere with it (do not manipulate ptr changing its pointed value or deleting it !!!!
Note:
This function informs the manager that this insatnce does not use enymore the previously stored pointer. It may have probably a strong influence on the pointed cell life time.
template<class Manager>
void utilmm::smart::pointer< Manager >::swap ( pointer< Manager > &  other  ) 

pointed cell exchange

Parameters:
other another instance

This function swaps the values of current instance and other.

template<class Manager>
void utilmm::smart::pointer< Manager >::swap ( pointer< Manager > &  other  ) 

pointed cell exchange

Parameters:
other another instance

This function swaps the values of current instance and other.


Member Data Documentation

template<class Manager>
singleton::use< Manager > utilmm::smart::pointer< Manager >::manager [private]

Definition at line 54 of file install/include/utilmm/smart/pointer.hh.

template<class Manager>
Manager::mem_cell utilmm::smart::pointer< Manager >::pointee [private]

Definition at line 201 of file install/include/utilmm/smart/pointer.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 10:07:43 2013