ArenaAllocatorRegistry implementation class.
More...
|
| typedef std::map< std::string, size_t > | map_t |
| | Map from names to indices.
|
| typedef std::lock_guard< std::mutex > | lock_t |
ArenaAllocatorRegistry implementation class.
Definition at line 30 of file ArenaAllocatorRegistry.cxx.
◆ lock_t
◆ map_t
◆ ~ArenaAllocatorRegistryImpl()
| SG::ArenaAllocatorRegistryImpl::~ArenaAllocatorRegistryImpl |
( |
| ) |
|
◆ create()
Create a new instance of an allocator.
- Parameters
-
| i | The index of the allocator to create. |
- Returns
- A newly-allocated allocator instance.
Definition at line 150 of file ArenaAllocatorRegistry.cxx.
151{
155}
std::vector< std::unique_ptr< ArenaAllocatorCreator > > m_creators
Vector of factory instances.
std::lock_guard< std::mutex > lock_t
std::mutex m_mutex
Mutex to protect the contents.
◆ lookup()
| size_t SG::ArenaAllocatorRegistryImpl::lookup |
( |
const std::string & | name | ) |
|
Look up the index for an allocator type name.
- Parameters
-
| name | The name of the allocator type to find. |
- Returns
- The index corresponding to the type, or
std::string::npos if it hasn't yet been registered.
Definition at line 133 of file ArenaAllocatorRegistry.cxx.
134{
136 map_t::iterator
it =
m_map.find (name);
137 if (it ==
m_map.end()) {
138 return std::string::npos;
139 }
141}
◆ registerCreator()
| size_t SG::ArenaAllocatorRegistryImpl::registerCreator |
( |
const std::string & | name, |
|
|
std::unique_ptr< ArenaAllocatorCreator > | creator ) |
Register a new allocator type.
- Parameters
-
| name | The name of the allocator type. |
| creator | The factory object to create instances of this type. The registry takes ownership of this pointer. |
- Returns
- The new integer index for this allocator type.
If the allocator type already exists, then the index of the existing one is returned (and the object passed as creator is deleted).
Definition at line 102 of file ArenaAllocatorRegistry.cxx.
104{
106
107
108
109
110
111 map_t::iterator
it =
m_map.find (name);
112 if (it !=
m_map.end()) {
113
115 }
116
117
119
120
124}
◆ m_creators
◆ m_map
| map_t SG::ArenaAllocatorRegistryImpl::m_map |
|
private |
◆ m_mutex
| std::mutex SG::ArenaAllocatorRegistryImpl::m_mutex |
|
private |
The documentation for this class was generated from the following file: