These are the entries in the DataCache. They store a value and an access counter. The counter can be read and written externally.
Create a new DataCacheEntry for the value. We also store the unhashed key to be able to detect hash collisions. The access counter is set to 1 to increase the chance that it is not flushed immedidate.
# File lib/taskjuggler/DataCache.rb, line 28 def initialize(unhashedKey, value) @unhashedKey = unhashedKey @value = value @hits = 1 end
Return the value and increase the access counter by 1.
# File lib/taskjuggler/DataCache.rb, line 35 def value if @hits <= 0 @hits = 1 else @hits += 1 end @value end