mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-15 07:14:46 +02:00
changes for 1.2.5
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// AbstractCache.h
|
||||
//
|
||||
// $Id: //poco/1.2/Foundation/include/Poco/AbstractCache.h#3 $
|
||||
// $Id: //poco/1.2/Foundation/include/Poco/AbstractCache.h#4 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Cache
|
||||
@@ -124,6 +124,25 @@ public:
|
||||
doClear();
|
||||
}
|
||||
|
||||
std::size_t size() const
|
||||
/// Returns the number of cached elements
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
return _data.size();
|
||||
}
|
||||
|
||||
void forceReplace()
|
||||
/// Forces cache replacement. Note that Poco's cache strategy use for efficiency reason no background thread
|
||||
/// which periodically triggers cache replacement. Cache Replacement is only started when the cache is modified
|
||||
/// from outside, i.e. add is called, or when a user tries to access an cache element via get.
|
||||
/// In some cases, i.e. expire based caching where for a long time no access to the cache happens,
|
||||
/// it might be desirable to be able to trigger cache replacement manually.
|
||||
{
|
||||
FastMutex::ScopedLock lock(_mutex);
|
||||
doReplace();
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
mutable BasicEvent<ValidArgs<TKey> > IsValid;
|
||||
mutable BasicEvent<KeySet> Replace;
|
||||
|
Reference in New Issue
Block a user