#include <coherence/net/cache/OldCache.hpp>
Public Types | |
typedef spec::Handle | Handle |
Entry Handle definition. | |
typedef spec::View | View |
Entry View definition. | |
typedef spec::Holder | Holder |
Entry Holder definition. | |
Public Member Functions | |
virtual bool | isExpired () const |
Determine if the cache entry has expired. | |
virtual int32_t | getPriority () const |
Calculate a cache priority. | |
virtual void | onAdd () |
virtual Object::Holder | setValue (Object::Holder ohValue) |
virtual TypedHandle < const String > | toString () const |
virtual int64_t | getCreatedMillis () const |
Determine when the cache entry was created. | |
virtual int64_t | getExpiryMillis () const |
Determine when the cache entry will expire, if ever. | |
virtual int64_t | getLastTouchMillis () const |
Determine when the cache entry was last touched. | |
virtual int32_t | getTouchCount () const |
Determine the number of times that the cache entry has been touched. | |
virtual size32_t | getUnits () const |
Determine the number of cache units used by this Entry. | |
virtual void | setExpiryMillis (int64_t lMillis) |
Specify when the cache entry will expire, or disable expiry. | |
virtual void | setUnits (int32_t cUnits) |
Specify the number of cache units used by this Entry. | |
Protected Member Functions | |
Entry (Object::View vKey, Object::Holder ohValue, size32_t nHash, OldCache::Handle hCache) | |
Create a new OldCache::Entry. | |
Entry (const Entry &that) | |
Copy constructor. | |
Entry (Entry::View vThat) | |
Copy an Entry. | |
virtual void | discard () |
Called to inform the Entry that it is no longer used. | |
virtual bool | isDiscarded () |
Determine if this entry has already been discarded from the cache. | |
virtual void | scheduleExpiry () |
Reschedule the cache entry expiration. | |
virtual void | touch () |
Called each time the entry is accessed or modified. | |
virtual void | resetTouchCount () |
Reset the number of times that the cache entry has been touched. | |
virtual size32_t | calculateUnits (Object::Holder ohValue) |
Calculate a cache cost for the specified object. | |
Protected Attributes | |
Volatile< int64_t > | m_dtCreated |
The time at which this entry was created. | |
Volatile< int64_t > | m_dtLastUse |
The time at which this Entry was last accessed. | |
Volatile< int64_t > | m_dtExpiry |
The time at which this Entry will (or did) expire. | |
int32_t | m_cUses |
The number of times that this Entry has been accessed. | |
size32_t | m_cUnits |
The number of units for the Entry. | |
FinalHandle< OldCache > | f_hCache |
Reference back to the original cache. |
Entry | ( | Object::View | vKey, | |
Object::Holder | ohValue, | |||
size32_t | nHash, | |||
OldCache::Handle | hCache | |||
) | [protected] |
Create a new OldCache::Entry.
vKey | the associated key | |
ohValue | the associated value | |
nHash | the associated hash code | |
hCache | reference to the cache containing this entry |
Entry | ( | Entry::View | vThat | ) | [protected] |
virtual bool isExpired | ( | ) | const [virtual] |
virtual int32_t getPriority | ( | ) | const [virtual] |
virtual bool isDiscarded | ( | ) | [protected, virtual] |
Determine if this entry has already been discarded from the cache.
virtual void resetTouchCount | ( | ) | [protected, virtual] |
Reset the number of times that the cache entry has been touched.
The touch count does not get reset to zero, but rather to a fraction of its former self; this prevents long lived items from gaining an unassailable advantage in the eviction process.
virtual size32_t calculateUnits | ( | Object::Holder | ohValue | ) | [protected, virtual] |
virtual int64_t getCreatedMillis | ( | ) | const [virtual] |
Determine when the cache entry was created.
virtual int64_t getExpiryMillis | ( | ) | const [virtual] |
Determine when the cache entry will expire, if ever.
virtual int64_t getLastTouchMillis | ( | ) | const [virtual] |
Determine when the cache entry was last touched.
virtual int32_t getTouchCount | ( | ) | const [virtual] |
virtual size32_t getUnits | ( | ) | const [virtual] |
virtual void setExpiryMillis | ( | int64_t | lMillis | ) | [virtual] |
Specify when the cache entry will expire, or disable expiry.
Note that if the cache is configured for automatic expiry, each subsequent update to this cache entry will reschedule the expiry time.
lMillis | pass the date/time value, in millis, for when the entry will expire, or pass zero to disable automatic expiry |
virtual void setUnits | ( | int32_t | cUnits | ) | [virtual] |