In Files

Parent

Methods

Class Index [+]

Quicksearch

TaskJuggler::DataCacheEntry

These are the entries in the DataCache. They store a value and an access counter. The counter can be read and written externally.

Attributes

hits[RW]

Public Class Methods

new(value) click to toggle source

Create a new DataCacheEntry for the value. The access counter is set to 1 to increase the chance that it is not flushed immedidate.

    # File lib/DataCache.rb, line 26
26:     def initialize(value)
27:       @value = value
28:       @hits = 1
29:     end

Public Instance Methods

value() click to toggle source

Return the value and increase the access counter by 1.

    # File lib/DataCache.rb, line 32
32:     def value
33:       if @hits <= 0
34:         @hits = 1
35:       else
36:         @hits += 1
37:       end
38:       @value
39:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.