Template class for a map of buffer pools.
| Key | Type of the map key. |
| UniqBuffer | Type of the unique pointers to the buffers. |
Definition at line 501 of file infer_utils.h.
Public Types | |
| using | SharedPool = SharedBufPool< UniqBuffer > |
| using | RecylePtr = typename BufferPool< UniqBuffer >::RecylePtr |
Public Member Functions | |
| MapBufferPool (const std::string &name) | |
| Construct the buffer pool map with a name. More... | |
| virtual | ~MapBufferPool () |
| Destructor. More... | |
| bool | setBuffer (const Key &key, UniqBuffer buf) |
| Add a buffer to the pool map. More... | |
| uint32_t | getPoolSize (const Key &key) |
| Get the size of a pool from the map. More... | |
| RecylePtr | acquireBuffer (const Key &key) |
| Acquire a buffer from the selected pool. More... | |
| void | clear () |
| Remove all pools from the map. More... | |
| MapBufferPool (const MapBufferPool &other)=delete | |
| Disable copy operations. More... | |
| MapBufferPool & | operator= (const MapBufferPool &other)=delete |
| using INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::RecylePtr = typename BufferPool<UniqBuffer>::RecylePtr |
Definition at line 504 of file infer_utils.h.
| using INFER_EXPORT_API::MapBufferPool< Key, UniqBuffer >::SharedPool = SharedBufPool<UniqBuffer> |
Definition at line 503 of file infer_utils.h.
|
inline |
Construct the buffer pool map with a name.
Definition at line 509 of file infer_utils.h.
|
inlinevirtual |
Destructor.
Print a debug message of number of pools in the map.
Definition at line 513 of file infer_utils.h.
References InferDebug, and INFER_EXPORT_API::safeStr().
|
delete |
Disable copy operations.
|
inline |
Acquire a buffer from the selected pool.
| key | Map key to identify the pool. |
Definition at line 571 of file infer_utils.h.
References InferDebug, InferWarning, and INFER_EXPORT_API::safeStr().
|
inline |
Remove all pools from the map.
Definition at line 586 of file infer_utils.h.
References InferDebug, and INFER_EXPORT_API::safeStr().
|
inline |
Get the size of a pool from the map.
| key | Map key of the pool. |
Definition at line 558 of file infer_utils.h.
|
delete |
|
inline |
Add a buffer to the pool map.
This function adds a new buffer to the pool specified by the key. If the pool for the key is not found, a new one is created.
| key | Map key of the pool in the map. |
| buf | Unique pointer to the buffer to be added. |
Definition at line 536 of file infer_utils.h.
References InferDebug, and INFER_EXPORT_API::safeStr().