Reference counting management.
More...
#include <utilmm/smart/bits/ref_count_manager.hh>
template<class Memory>
class utilmm::smart::ref_count::manager< Memory >
Reference counting management.
- Parameters
-
| 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
- Note
utilmm::smart::simple_memory is a quite simple and illustrative model for Memory
- Author
- Frédéric Py fpy@l.nosp@m.aas..nosp@m.fr
◆ base_type
public type of pointed cells
◆ 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.
◆ assign()
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.
- Parameters
-
- Postcondition
- reference counter of c is incremented by 1
- Returns
- c ater the operation
◆ get_ptr()
real pointer value.
This function give an access to the real pointer value of a given cell.
- Parameters
-
- Returns
- the pointer value of the cell
◆ manage()
Add new pointer in management.
- Parameters
-
This function is called by smart::pointer when this one wants to add a new pointer to the manager management.
- Returns
- The cell corresponding to this pointer.
◆ null()
Check if null.
Check if a given cell points to nothing
- Parameters
-
- Return values
-
| true | if c is null |
| false | else |
◆ release()
Unassignement of a cell.
This function is called by utilmm::smart::pointer to indicate that a pointer has stopped to used a given cell.
- Parameters
-
- Postcondition
- The counter for c is decrmented by 1 and, if this counter has reached the 0 value the cell is detroyed.
◆ singleton::wrapper
template<class Memory >
template<class Ty >
The documentation for this class was generated from the following file: