#include <utilmm/smart/pointer.hh>
Public Types | |
| typedef Manager::base_type | base_type |
| Pointed type. | |
| typedef base_type * | pointer_type |
| basic pointer type | |
| typedef base_type & | reference_type |
| Basic reference type. | |
Public Member Functions | |
| pointer (pointer_type ptr=0) | |
| Constructor. | |
| pointer (pointer const &other) | |
| Copy constructor. | |
| ~pointer () | |
| Destructor. | |
| void | reset (pointer_type ptr=0) |
| Checnging pointed value. | |
| void | swap (pointer &other) |
| pointed cell exchange | |
| pointer & | operator= (pointer const &other) |
| Assignement operator. | |
| bool | null () const |
| Check if null. | |
| bool | operator! () const |
| Check if null. | |
| bool | operator== (pointer const &other) const |
| Equality test. | |
| bool | operator!= (pointer const &other) const |
| Difference test. | |
| pointer_type | operator-> () const |
| Access operator. | |
| reference_type | operator * () const |
| dereference operator | |
This class is a generic definition of smart pointer. It uses a memory manager to manage the pointers.
| Manager | The memory manager |
s | typedef Manager::base_type utilmm::smart::pointer< Manager >::base_type |
Pointed type.
This is the type of the element pointed by this pointer
| typedef base_type* utilmm::smart::pointer< Manager >::pointer_type |
| typedef base_type& utilmm::smart::pointer< Manager >::reference_type |
Basic reference type.
This is the type of the classical C++ reference for base_type
| utilmm::smart::pointer< Manager >::pointer | ( | pointer_type | ptr = 0 |
) | [explicit] |
| utilmm::smart::pointer< Manager >::pointer | ( | pointer< Manager > const & | other | ) |
Copy constructor.
| other | The instance to copy. |
This will probably influence the life time of the pointed cell
| utilmm::smart::pointer< Manager >::~pointer | ( | ) |
| void utilmm::smart::pointer< Manager >::reset | ( | pointer_type | ptr = 0 |
) |
Checnging pointed value.
| ptr | The new pointer to manage |
| void utilmm::smart::pointer< Manager >::swap | ( | pointer< Manager > & | other | ) |
pointed cell exchange
| other | another instance |
| pointer& utilmm::smart::pointer< Manager >::operator= | ( | pointer< Manager > const & | other | ) |
Assignement operator.
| other | The instance to assign |
| bool utilmm::smart::pointer< Manager >::null | ( | ) | const |
Check if null.
| true | if current insatnce is pointing to nothing | |
| false | else |
| bool utilmm::smart::pointer< Manager >::operator! | ( | ) | const |
Check if null.
| true | if current insatnce is pointing to nothing | |
| false | else |
| bool utilmm::smart::pointer< Manager >::operator== | ( | pointer< Manager > const & | other | ) | const |
Equality test.
| other | The instance to compare |
| true | If current insatnce points to the samme cell as other | |
| false | else |
| bool utilmm::smart::pointer< Manager >::operator!= | ( | pointer< Manager > const & | other | ) | const |
Difference test.
| other | The instance to compare |
!operator==(other)| pointer_type utilmm::smart::pointer< Manager >::operator-> | ( | ) | const |
Access operator.
Thsi operator gives direct access to the attributes of pointed value
| utilmm::null_access | This insatnce points to nothing |
| reference_type utilmm::smart::pointer< Manager >::operator * | ( | ) | const |
dereference operator
| utilmm::null_access | This insatnce points to nothing |
1.5.3