[This is preliminary documentation and is subject to change.]
The ICacheTable TKey type exposes the following members.Methods
Name | Description | |
---|---|---|
![]() | ContainsKey |
Returns true if cache has object with the key, optionally filtering-out objects older than ageSec param if it is > zero.
Returns false if there is no object with the specified key or it is older than ageSec limit.
|
![]() | Get |
Gets cache object by key, optionally filtering-out objects older than ageSec param if it is > zero.
Returns null if there is no object with the specified key or it is older than ageSec limit.
|
![]() | GetOrPut |
Atomically tries to get object by key if it exists, otherwise calls a factory method under lock and puts the data with the specified parameters.
'newPutResult' returns the result of the put after factory method call.
Keep in mind, that even if a factory method created a new object, there may be a case when the value
could not be physically inserted in the cache because of a collision (data with higher priority occupies space and space is capped), so check for
'newPutResult' value which is null in case of getting an existing item.
Returns object that was gotten or created anew
|
![]() | Purge |
Removes all data from table
(Inherited from ICacheTable.) |
![]() | Put |
Puts an object identified by a key into cache returning the result of the put.
For example, put may have added nothing if the table is capped and the space is occupied with data of higher priority
|
![]() | Rejuvenate |
Resets inetrnal object age returning true of object was found and rejuvenated
|
![]() | Remove |
Removes data by key returning true if found and removed
|
![]() | SizeOfValue |
Returns the size of stored object if cache has object with the key, optionally filtering-out objects older than ageSec param if it is > zero.
|
Properties
Name | Description | |
---|---|---|
![]() | Cache |
References cache that this table is under
(Inherited from ICacheTable.) |
![]() | Capacity |
Returns how many slots/entries allocated in a table
(Inherited from ICacheTable.) |
![]() | Count |
Returns how many records are kept in a table
(Inherited from ICacheTable.) |
![]() | KeyComparer |
Returns equality comparer for keys, or null to use default Equals
|
![]() | LoadFactor |
Returns the percentage of occupied table slots.
When this number exceeds high-water-mark threshold the table is grown,
otheriwse if the number falls below the low-water-mark level then the table is shrunk
(Inherited from ICacheTable.) |
![]() | Name | (Inherited from INamed.) |
![]() | Options |
Cache table options in effect
(Inherited from ICacheTable.) |
See Also