Util--  1.1
ref_count_manager.hh
Go to the documentation of this file.
1 /* -*- C++ -*-
2  * $Id: ref_count_manager.hh 957 2005-03-07 16:01:20Z sjoyeux $
3  */
4 #ifndef UTILMM_SMART_REF_COUNT_MANAGER_HEADER
5 # define UTILMM_SMART_REF_COUNT_MANAGER_HEADER
6 
8 
9 namespace utilmm {
10  namespace smart {
17  namespace ref_count {
18 
34  template<class Memory>
35  class manager {
36  public:
38  typedef typename Memory::base_type base_type;
45  typedef typename Memory::mem_cell mem_cell;
46 
56  mem_cell manage(base_type *ptr);
68  mem_cell assign(mem_cell c);
69 
80  void release(mem_cell c);
81 
90  bool null(mem_cell c) {
91  return c==mem.null_cell();
92  }
93 
103  base_type *get_ptr(mem_cell c) {
104  return c->first;
105  }
106 
107  private:
108  manager() {}
109 
110  ~manager() {}
111 
112  Memory mem;
113 
114  template<class Ty>
115  friend class singleton::wrapper;
116  }; // class utilmm::smart::ref_count::manager<>
117 
118  } // namespace utilmm::smart::ref_count
119  } // namespace utilmm::smart
120 } // namespace utilmm
121 
122 # define IN_UTILMM_SMART_REF_COUNT_MANAGER_HEADER
123 #include "utilmm/smart/bits/ref_count_manager.tcc"
124 # undef IN_UTILMM_SMART_REF_COUNT_MANAGER_HEADER
125 #endif // UTILMM_SMART_REF_COUNT_MANAGER_HEADER
126 
Memory::mem_cell mem_cell
real type of pointed cells
Definition: ref_count_manager.hh:45
base_type * get_ptr(mem_cell c)
real pointer value.
Definition: ref_count_manager.hh:103
void release(mem_cell c)
Unassignement of a cell.
Reference counting management.
Definition: ref_count_manager.hh:35
mem_cell manage(base_type *ptr)
Add new pointer in management.
mem_cell assign(mem_cell c)
Assignment of a cell.
Forward declaration of utilmm::singleton::wrapper.
Wrapper for singleton instances.
Definition: wrapper.hh:31
Definition: auto_flag.hh:6
bool null(mem_cell c)
Check if null.
Definition: ref_count_manager.hh:90
Memory::base_type base_type
public type of pointed cells
Definition: ref_count_manager.hh:38

Generated on Mon Oct 22 2018 18:39:28 for Util-- by doxygen 1.8.13
SourceForge.net Project Page