PMDA++
0.4.4
Header-only C++ library for writing PCP PMDAs
|
Classes | |
struct | lookup_result_type |
Structure for return results from pcp::cache::lookup functions. More... | |
Enumerations | |
enum | lookup_flags { require_active = 0x1 } |
Flags that may be applied to cache lookups. More... | |
Functions | |
lookup_flags | operator| (lookup_flags a, lookup_flags b) |
Pipe operator for combining lookup_flags values. More... | |
template<typename Type > | |
lookup_result_type< Type > | lookup (const pmInDom indom, const instance_id_type instance_id, const lookup_flags flags=require_active) |
Lookup a cache entry, by instance ID. More... | |
template<typename Type > | |
lookup_result_type< Type > | lookup (const pmInDom indom, const std::string &name, const lookup_flags flags=require_active) |
Lookup a cache entry, by instance name. More... | |
template<typename Type > | |
lookup_result_type< Type > | lookup (const pmInDom indom, const std::string &name, const std::string &key, const lookup_flags flags=require_active) |
Lookup a cache entry, by instance name and key. More... | |
int | perform (const pmInDom indom, const int operation) |
Perform additional operations on the cache. More... | |
size_t | purge (const pmInDom indom, const time_t recent) |
Purge cache entries that have not been active for some time. More... | |
size_t | purge (const pmInDom indom, const boost::posix_time::time_duration &recent) |
Purge cache entries that have not been active for some time. More... | |
instance_id_type | store (const pmInDom indom, const std::string &name, const int flags=PMDA_CACHE_ADD, void *const opaque=NULL) |
Add a item to the cache. More... | |
instance_id_type | store (const pmInDom indom, const std::string &name, void *const opaque, const int flags=PMDA_CACHE_ADD) |
Add a item to the cache. More... | |
instance_id_type | store (const pmInDom indom, const std::string &name, const std::string &key, const int flags=0, void *const opaque=NULL) |
Add a item to the cache. More... | |
instance_id_type | store (const pmInDom indom, const std::string &name, const std::string &key, void *const opaque, const int flags=0) |
Add a item to the cache. More... | |
lookup_result_type<Type> pcp::cache::lookup | ( | const pmInDom | indom, |
const instance_id_type | instance_id, | ||
const lookup_flags | flags = require_active |
||
) |
Lookup a cache entry, by instance ID.
If flags includes require_active, and an inactive cache entry is found, a pcp::exception will be thrown instead of the inactive entry returned.
Type | Type to cast opaque pointers to. |
indom | Instance domain to lookup. |
instance_id | Instance ID to lookup. |
flags | Optional flags that alter the function's behaviour. |
pcp::exception | If no cache entry entry found. |
Definition at line 83 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::instance_id, pcp::cache::lookup_result_type< Type >::name, pcp::cache::lookup_result_type< Type >::opaque, require_active, and pcp::cache::lookup_result_type< Type >::status.
lookup_result_type<Type> pcp::cache::lookup | ( | const pmInDom | indom, |
const std::string & | name, | ||
const lookup_flags | flags = require_active |
||
) |
Lookup a cache entry, by instance name.
If flags includes require_active, and an inactive cache entry is found, a pcp::exception will be thrown instead of the inactive entry returned.
Type | Type to cast opaque pointers to. |
indom | Instance domain to lookup. |
name | Instance name to lookup. |
flags | Optional flags that alter the function's behaviour. |
pcp::exception | If no cache entry entry found. |
Definition at line 129 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::instance_id, pcp::cache::lookup_result_type< Type >::name, pcp::cache::lookup_result_type< Type >::opaque, require_active, and pcp::cache::lookup_result_type< Type >::status.
lookup_result_type<Type> pcp::cache::lookup | ( | const pmInDom | indom, |
const std::string & | name, | ||
const std::string & | key, | ||
const lookup_flags | flags = require_active |
||
) |
Lookup a cache entry, by instance name and key.
If flags includes require_active, and an inactive cache entry is found, a pcp::exception will be thrown instead of the inactive entry returned.
Type | Type to cast opaque pointers to. |
indom | Instance domain to lookup. |
name | Instance name to lookup. |
key | Instance key to lookup. |
flags | Optional flags that alter the function's behaviour. |
pcp::exception | If no cache entry entry found. |
Definition at line 171 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::instance_id, pcp::cache::lookup_result_type< Type >::name, pcp::cache::lookup_result_type< Type >::opaque, require_active, and pcp::cache::lookup_result_type< Type >::status.
|
inline |
Pipe operator for combining lookup_flags values.
This function performs a logical OR of two lookup_flags sets. This is a convenience function, allowing lookup_flags enum values to be used both standalone, and in combination.
a | First set of flags. |
b | Second set of flags. |
|
inline |
Perform additional operations on the cache.
This is a very simple wrapper for PCP's pmdaCacheOp function.
indom | Instance domain to operate on. |
operation | Operation to perform. Should be one of the PMDA_CACHE_* constants. |
pcp::exception | On errors. |
|
inline |
Purge cache entries that have not been active for some time.
indom | Instance domain to purge entries for. |
recent | All entries that have not been active within this many seconds will be purged. |
pcp::exception | On error. |
Definition at line 232 of file cache.hpp.
Referenced by purge().
|
inline |
Purge cache entries that have not been active for some time.
indom | Instance domain to purge entries for. |
recent | All entries that have not been active within this interval will be purged. |
pcp::exception | On error. |
Definition at line 255 of file cache.hpp.
References purge().
|
inline |
Add a item to the cache.
indom | Instance domain to add an entry for. |
name | Instance name to add to the cache. |
flags | Optional flags to be passed to pmdaCacheStore. |
opaque | Optional opaque pointer to be include in the cache entry. |
pcp::exception | On error. |
Definition at line 275 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::opaque.
Referenced by pcp::pmda::parse_command_line().
|
inline |
Add a item to the cache.
indom | Instance domain to add an entry for. |
name | Instance name to add to the cache. |
opaque | Optional opaque pointer to be include in the cache entry. |
flags | Optional flags to be passed to pmdaCacheStore. |
pcp::exception | On error. |
Definition at line 300 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::opaque.
|
inline |
Add a item to the cache.
indom | Instance domain to add an entry for. |
key | Hint to pass to pmdaCacheStoreKey. See pmdaCacheStoreKey for details. |
name | Instance name to add to the cache. |
flags | Optional flags to be passed to pmdaCacheStore. |
opaque | Optional opaque pointer to be include in the cache entry. |
pcp::exception | On error. |
Definition at line 326 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::opaque.
|
inline |
Add a item to the cache.
indom | Instance domain to add an entry for. |
key | Hint to pass to pmdaCacheStoreKey. See pmdaCacheStoreKey for details. |
name | Instance name to add to the cache. |
opaque | Optional opaque pointer to be include in the cache entry. |
flags | Optional flags to be passed to pmdaCacheStore. |
pcp::exception | On error. |
Definition at line 354 of file cache.hpp.
References pcp::cache::lookup_result_type< Type >::opaque.