#include <OW_Cache.hpp>
Collaboration diagram for OW_NAMESPACE::Cache< T >:
Public Member Functions | |
Cache () | |
void | addToCache (const T &cc, const String &key) |
Add an item to the cache. | |
T | getFromCache (const String &key) |
Get an item from the cache. | |
void | removeFromCache (const String &key) |
Remove an item from the cache. | |
void | clearCache () |
Remove all items from the cache. | |
void | setMaxCacheSize (UInt32) |
Set the maximum number of items the cache will hold. | |
Private Types | |
typedef std::list< std::pair< T, String > > | class_cache_t |
typedef __gnu_cxx::hash_map< String, typename class_cache_t::iterator > | cache_index_t |
Private Attributes | |
class_cache_t | theCache |
cache_index_t | theCacheIndex |
Mutex | cacheGuard |
UInt32 | maxCacheSize |
Definition at line 53 of file OW_Cache.hpp.
|
Definition at line 100 of file OW_Cache.hpp. |
|
Definition at line 97 of file OW_Cache.hpp. |
|
Definition at line 108 of file OW_Cache.hpp. |
|
Add an item to the cache.
Definition at line 115 of file OW_Cache.hpp. References OW_NAMESPACE::Cache< T >::cacheGuard, OW_NAMESPACE::Cache< T >::maxCacheSize, OW_NAMESPACE::Cache< T >::theCache, and OW_NAMESPACE::Cache< T >::theCacheIndex. Referenced by OW_NAMESPACE::MOF::CIMOMVisitor::CIMOMprocessQualifierType(), OW_NAMESPACE::MetaRepository::getCIMClass(), OW_NAMESPACE::MOF::CIMOMVisitor::getClass(), OW_NAMESPACE::MOF::CIMOMVisitor::getQualifierType(), OW_NAMESPACE::MetaRepository::getQualifierType(), OW_NAMESPACE::ProviderAgentCIMOMHandle::helperGetClass(), OW_NAMESPACE::ProviderAgentEnvironment::ProviderAgentEnvironment(), and OW_NAMESPACE::MetaRepository::setQualifierType(). |
|
Remove all items from the cache.
Definition at line 170 of file OW_Cache.hpp. References OW_NAMESPACE::Cache< T >::cacheGuard, OW_NAMESPACE::Cache< T >::theCache, and OW_NAMESPACE::Cache< T >::theCacheIndex. Referenced by OW_NAMESPACE::MetaRepository::deleteNameSpace(). |
|
Get an item from the cache. Average complexity is constant time. Worst case is linear in the size of the cache.
Definition at line 134 of file OW_Cache.hpp. References OW_NAMESPACE::Cache< T >::cacheGuard, OW_NAMESPACE::CIMNULL, i, OW_NAMESPACE::Cache< T >::theCache, and OW_NAMESPACE::Cache< T >::theCacheIndex. Referenced by OW_NAMESPACE::MetaRepository::getCIMClass(), OW_NAMESPACE::MOF::CIMOMVisitor::getClass(), OW_NAMESPACE::MOF::CIMOMVisitor::getQualifierType(), OW_NAMESPACE::MetaRepository::getQualifierType(), and OW_NAMESPACE::ProviderAgentCIMOMHandle::helperGetClass(). |
|
Remove an item from the cache. Average complexity is constant time. Worst case is linear in the size of the cache. It does not matter if the item is not in the cache. getFromCache(key) will return T(CIMNULL)
Definition at line 156 of file OW_Cache.hpp. References OW_NAMESPACE::Cache< T >::cacheGuard, i, OW_NAMESPACE::Cache< T >::theCache, and OW_NAMESPACE::Cache< T >::theCacheIndex. Referenced by OW_NAMESPACE::MetaRepository::deleteClass(), OW_NAMESPACE::MetaRepository::deleteQualifierType(), OW_NAMESPACE::MetaRepository::modifyClass(), and OW_NAMESPACE::MetaRepository::setQualifierType(). |
|
Set the maximum number of items the cache will hold. This will shrink the cache if necessary. Definition at line 179 of file OW_Cache.hpp. References OW_NAMESPACE::Cache< T >::cacheGuard, OW_NAMESPACE::Cache< T >::maxCacheSize, OW_NAMESPACE::Cache< T >::theCache, and OW_NAMESPACE::Cache< T >::theCacheIndex. Referenced by OW_NAMESPACE::MetaRepository::init(), OW_NAMESPACE::MetaRepository2::MetaRepository2(), and OW_NAMESPACE::ProviderAgentEnvironment::ProviderAgentEnvironment(). |
|
Definition at line 103 of file OW_Cache.hpp. Referenced by OW_NAMESPACE::Cache< T >::addToCache(), OW_NAMESPACE::Cache< T >::clearCache(), OW_NAMESPACE::Cache< T >::getFromCache(), OW_NAMESPACE::Cache< T >::removeFromCache(), and OW_NAMESPACE::Cache< T >::setMaxCacheSize(). |
|
Definition at line 104 of file OW_Cache.hpp. Referenced by OW_NAMESPACE::Cache< T >::addToCache(), and OW_NAMESPACE::Cache< T >::setMaxCacheSize(). |
|
Definition at line 101 of file OW_Cache.hpp. Referenced by OW_NAMESPACE::Cache< T >::addToCache(), OW_NAMESPACE::Cache< T >::clearCache(), OW_NAMESPACE::Cache< T >::getFromCache(), OW_NAMESPACE::Cache< T >::removeFromCache(), and OW_NAMESPACE::Cache< T >::setMaxCacheSize(). |
|
Definition at line 102 of file OW_Cache.hpp. Referenced by OW_NAMESPACE::Cache< T >::addToCache(), OW_NAMESPACE::Cache< T >::clearCache(), OW_NAMESPACE::Cache< T >::getFromCache(), OW_NAMESPACE::Cache< T >::removeFromCache(), and OW_NAMESPACE::Cache< T >::setMaxCacheSize(). |