| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package EntityModel::Cache; |
|
2
|
|
|
|
|
|
|
{ |
|
3
|
|
|
|
|
|
|
$EntityModel::Cache::VERSION = '0.102'; |
|
4
|
|
|
|
|
|
|
} |
|
5
|
|
|
|
|
|
|
use EntityModel::Class { |
|
6
|
15
|
|
|
15
|
|
76083
|
}; |
|
|
15
|
|
|
|
|
82627
|
|
|
|
15
|
|
|
|
|
116
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
EntityModel::Cache - base class for L caching support |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
version 0.102 |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
See L. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
See L. |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=cut |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 new |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Instantiate class. Currently takes no parameters. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=cut |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new { |
|
37
|
1
|
|
|
1
|
1
|
1545
|
my $class = shift; |
|
38
|
1
|
|
|
|
|
4
|
my $self = bless { }, $class; |
|
39
|
1
|
|
|
|
|
2
|
return $self; |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 get |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Get value from the cache corresponding to the given key. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
|
47
|
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
1
|
|
sub get { die 'Virtual method' } |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 remove |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Remove the given key from the cache. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=cut |
|
55
|
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
1
|
|
sub remove { die 'Virtual method' } |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 incr |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Atomically increment the value for the given key. |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=cut |
|
63
|
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
1
|
|
sub incr { die 'Virtual method' } |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 incr |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Atomically decrement the value for the given key. |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
|
71
|
|
|
|
|
|
|
|
|
72
|
0
|
|
|
0
|
0
|
|
sub decr { die 'Virtual method' } |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 set |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Set the value for the given key. Optionally provide a timeout value as 3rd parameter. |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
|
79
|
|
|
|
|
|
|
|
|
80
|
0
|
|
|
0
|
1
|
|
sub set { die 'Virtual method' } |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 atomic |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Atomic set. Locks until the coderef is complete and returns the value. |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=cut |
|
87
|
|
|
|
|
|
|
|
|
88
|
0
|
|
|
0
|
1
|
|
sub atomic { die 'Virtual method' } |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |