|
Kagome
Polkadot Runtime Engine in C++17
|
#include <objects_cache.hpp>
Public Types | |
| using | Type = T |
| using | ObjectPtr = std::shared_ptr< Type > |
Public Member Functions | |
| ObjectsCache & | operator= (const ObjectsCache &)=delete |
| ObjectsCache (const ObjectsCache &)=delete | |
| ObjectsCache & | operator= (ObjectsCache &&)=delete |
| ObjectsCache (ObjectsCache &&)=delete | |
| ObjectsCache ()=default | |
| ObjectsCache (Alloc &alloc) | |
| virtual | ~ObjectsCache () |
| Type * | getCachedObject () |
| void | setCachedObject (Type *const ptr) |
| ObjectPtr | getSharedCachedObject () |
Private Types | |
| using | ObjectsArray = std::vector< Type * > |
Private Member Functions | |
| Type * | getRawPtr () |
| void | setRawPtr (Type *const ptr) |
Private Attributes | |
| Alloc | allocator_ |
| std::mutex | cache_blocker_ |
| ObjectsArray | cache_ |
Single type cache container. Contains the set of objects to be cached.
| T | is the type ob objects to be contained. |
| Alloc | is the allocator type |
Definition at line 39 of file objects_cache.hpp.
| using tools::containers::ObjectsCache< T, Alloc >::ObjectPtr = std::shared_ptr<Type> |
Definition at line 44 of file objects_cache.hpp.
|
private |
Definition at line 88 of file objects_cache.hpp.
| using tools::containers::ObjectsCache< T, Alloc >::Type = T |
Definition at line 43 of file objects_cache.hpp.
|
delete |
|
delete |
|
default |
|
inline |
Definition at line 53 of file objects_cache.hpp.
|
inlinevirtual |
Destroy cached objects.
Definition at line 58 of file objects_cache.hpp.
|
inline |
Extracts raw pointer to the object from the cache.
Definition at line 68 of file objects_cache.hpp.
|
inlineprivate |
Definition at line 94 of file objects_cache.hpp.
|
inline |
Pops object from cache and returns a shared_ptr, contained this object.
Definition at line 83 of file objects_cache.hpp.
|
delete |
|
delete |
|
inline |
Returns raw pointer to the object back to cache.
Definition at line 75 of file objects_cache.hpp.
|
inlineprivate |
Definition at line 106 of file objects_cache.hpp.
|
private |
Definition at line 90 of file objects_cache.hpp.
|
private |
Definition at line 92 of file objects_cache.hpp.
|
private |
Definition at line 91 of file objects_cache.hpp.