|
Util--
1.1
|
Reference counting management. More...
#include <utilmm/smart/bits/ref_count_manager.hh>
Public Types | |
| typedef Memory::base_type | base_type |
| public type of pointed cells More... | |
| typedef Memory::mem_cell | mem_cell |
| real type of pointed cells More... | |
Public Member Functions | |
| mem_cell | manage (base_type *ptr) |
| Add new pointer in management. More... | |
| mem_cell | assign (mem_cell c) |
| Assignment of a cell. More... | |
| void | release (mem_cell c) |
| Unassignement of a cell. More... | |
| bool | null (mem_cell c) |
| Check if null. More... | |
| base_type * | get_ptr (mem_cell c) |
| real pointer value. More... | |
Friends | |
| template<class Ty > | |
| class | singleton::wrapper |
Reference counting management.
| Memory | a model for the memory |
This class is a manager for smart::pointer that control the life time policy of memory cells managed by Memory
utilmm::smart::simple_memory is a quite simple and illustrative model for Memory | typedef Memory::base_type utilmm::smart::ref_count::manager< Memory >::base_type |
public type of pointed cells
| typedef Memory::mem_cell utilmm::smart::ref_count::manager< Memory >::mem_cell |
real type of pointed cells
This type will store all the information of the reference counter it may be compatible with the std::pair<base_type,size_t>* type.
| mem_cell utilmm::smart::ref_count::manager< Memory >::assign | ( | mem_cell | c | ) |
Assignment of a cell.
This function is called by utilmm::smart::pointer to indicate to the manager that a given cell is assigned to a new pointer.
| c | The cell assigned |
|
inline |
real pointer value.
This function give an access to the real pointer value of a given cell.
| c | The cell |
| mem_cell utilmm::smart::ref_count::manager< Memory >::manage | ( | base_type * | ptr | ) |
Add new pointer in management.
| ptr | The pointer to manage |
This function is called by smart::pointer when this one wants to add a new pointer to the manager management.
|
inline |
Check if null.
Check if a given cell points to nothing
| c | The cell to check |
| true | if c is null |
| false | else |
| void utilmm::smart::ref_count::manager< Memory >::release | ( | mem_cell | c | ) |
Unassignement of a cell.
This function is called by utilmm::smart::pointer to indicate that a pointer has stopped to used a given cell.
| c | The cell released |
1.8.11