|
template<typename T > |
std::enable_if_t< std::is_same< KeyType, std::string >::value &&!std::is_same< KeyType, const char * >::value, T > | get (const std::string &key) const |
| Specialization for key of type std::string. More...
|
|
template<typename T > |
std::enable_if_t< std::is_same< KeyType, const char * >::value &&!std::is_same< KeyType, std::string >::value, T > | get (const char *key) const |
| Specialization for string literals. More...
|
|
template<typename T > |
std::enable_if_t<!std::is_same< KeyType, const char * >::value &&!std::is_same< KeyType, std::string >::value, T > | get (const KeyType &key) const |
|
template<typename T > |
void | set (const KeyType &key, const T &obj) |
|
template<typename T > |
void | set (const KeyType &key, const T &obj, const std::chrono::steady_clock::time_point &expire_at) |
|
void | erase (const KeyType &key) |
| Erase an entry for the store. More...
|
|
bool | has (const KeyType &key) const |
|
void | purge () |
| Remove expired entry from the store. More...
|
|
size_t | size () const |
|
template<typename KeyType = std::string>
class Leosac::Registry< KeyType >
A simple container that can holds object of any type.
This is basically a map<string, boost::any>. Type safety is enforced at runtime, and trying to retrieve an object of type that doesn't match will result in an assertion.
While the registry supports concept of expiration for its entry, it is not designed to prevent access to expired object. Instead, its goal is to remove expired from time to time to prevent infinite memory grows.
- Note
- The registry is templated on the key type.
Definition at line 55 of file Registry.hpp.