List of all members.
Classes |
struct | Data |
| One cache entry. More...
|
struct | Item |
Public Member Functions |
CO_API | InstanceCache (const uint64_t maxSize=LB_100MB) |
| Construct a new instance cache.
|
CO_API | ~InstanceCache () |
| Destruct this instance cache.
|
CO_API bool | add (const ObjectVersion &rev, const uint32_t instanceID, Command &command, const uint32_t usage=0) |
| Add a new command to the instance cache.
|
void | remove (const NodeID &node) |
| Remove all items from the given node.
|
CO_API const Data & | operator[] (const UUID &id) |
| Direct access to the cached instance data for the given object id.
|
CO_API bool | release (const UUID &id, const uint32_t count) |
| Release the retrieved instance data of the given object.
|
CO_API bool | erase (const UUID &id) |
| Erase all the data for the given object.
|
uint64_t | getSize () const |
uint64_t | getMaxSize () const |
void | expire (const int64_t age) |
| Remove all items which are older than the given time.
|
bool | isEmpty () |
Detailed Description
Definition at line 36 of file instanceCache.h.
Constructor & Destructor Documentation
Construct a new instance cache.
Destruct this instance cache.
Member Function Documentation
Add a new command to the instance cache.
- Parameters:
-
rev | the object identifier and version. |
instanceID | the master instance ID. |
command | The command to add. |
usage | pre-set usage count. |
- Returns:
- true if the command was entered, false if not.
Erase all the data for the given object.
The data does not have to be accessed, i.e., release has been called for each previous access.
- Returns:
- true if the element was erased, false otherwise.
Remove all items which are older than the given time.
- Returns:
- the maximum number of bytes used by the instance cache.
Definition at line 110 of file instanceCache.h.
- Returns:
- the number of bytes used by the instance cache.
Definition at line 107 of file instanceCache.h.
CO_API const Data& co::InstanceCache::operator[] |
( |
const UUID & |
id | ) |
|
Direct access to the cached instance data for the given object id.
The instance data for the given object has to be released by the caller, unless 0 has been returned. Not all returned data stream might be ready.
- Parameters:
-
id | the identifier of the object to look up. |
- Returns:
- the list of cached instance datas, or Data::NONE if no data is cached for this object.
Release the retrieved instance data of the given object.
- Parameters:
-
id | the identifier of the object to release. |
count | the number of access operations to release |
- Returns:
- true if the element was unpinned, false if it is not in the instance cache.
Remove all items from the given node.
The documentation for this class was generated from the following file: