MySQL 9.1.0
Source Code Documentation
|
A class to manage objects of type T. More...
#include <ut0object_cache.h>
Public Member Functions | |
~Object_cache () | |
Destructor. More... | |
template<typename... Types> | |
dberr_t | init (size_t size, size_t step, Types &&...args) |
Initialize the cache. More... | |
template<typename... Types> | |
T * | allocate (Types &&...args) |
template<typename... Types> | |
dberr_t | extend (size_t size, Types &&...args) |
void | deallocate (T *obj) |
Private Attributes | |
std::vector< T * > | m_objects |
Cached objects. More... | |
size_t | m_step {1} |
When the cache is extended, how many new objects needs to be created. More... | |
size_t | m_index {0} |
Position of next object to be allocated. More... | |
A class to manage objects of type T.
|
inline |
Destructor.
Frees the cached objects.
|
inline |
|
inline |
|
inline |
|
inline |
Initialize the cache.
[in] | size | initial number of objects to cache. |
[in] | step | when extending cache, number of objects to add. |
[in] | args | arguments to be passed to constructor of T |
|
private |
Position of next object to be allocated.
|
private |
Cached objects.
|
private |
When the cache is extended, how many new objects needs to be created.