line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
=head1 NAME |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
Cache::Null::Entry - An entry in the Null implementation of Cache |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 SYNOPSIS |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
See 'Cache::Entry' for a synopsis. |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
This module implements a version of Cache::Entry for the Cache::Null variant |
12
|
|
|
|
|
|
|
of Cache. It should not be created or used directly, please see |
13
|
|
|
|
|
|
|
'Cache::Null' or 'Cache::Entry' instead. |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=cut |
16
|
|
|
|
|
|
|
package Cache::Null::Entry; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
require 5.006; |
19
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
73
|
|
20
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
21
|
2
|
|
|
2
|
|
588
|
use Cache::IOString; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
58
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
2
|
|
11
|
use base qw(Cache::Entry); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
964
|
|
24
|
2
|
|
|
2
|
|
94
|
use fields qw(); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
663
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
our $VERSION = '2.10'; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub new { |
30
|
1
|
|
|
1
|
0
|
3
|
my Cache::Null::Entry $self = shift; |
31
|
|
|
|
|
|
|
|
32
|
1
|
50
|
|
|
|
8
|
$self = fields::new($self) unless ref $self; |
33
|
1
|
|
|
|
|
264
|
$self->SUPER::new(@_); |
34
|
|
|
|
|
|
|
|
35
|
1
|
|
|
|
|
3
|
return $self; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub exists { |
39
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
40
|
4
|
|
|
4
|
1
|
31
|
return 0; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub set { |
44
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
45
|
1
|
|
|
1
|
1
|
3
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub get { |
49
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
50
|
4
|
|
|
4
|
1
|
28
|
return undef; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub size { |
54
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
55
|
2
|
|
|
2
|
1
|
13
|
return undef; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub remove { |
59
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
60
|
1
|
|
|
1
|
1
|
2
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub expiry { |
64
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
65
|
0
|
|
|
0
|
1
|
0
|
return undef; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub set_expiry { |
69
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
70
|
0
|
|
|
0
|
1
|
0
|
return; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub _handle { |
74
|
4
|
|
|
4
|
|
7
|
my Cache::Null::Entry $self = shift; |
75
|
4
|
|
|
|
|
6
|
my ($mode) = @_; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# return undef unless writing - otherwise return a dummy handle |
78
|
4
|
100
|
|
|
|
35
|
return undef unless $mode =~ />|\+/; |
79
|
3
|
|
|
|
|
4
|
my $data = ''; |
80
|
3
|
|
|
|
|
36
|
return Cache::IOString->new(\$data, $mode); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub validity { |
84
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
85
|
0
|
|
|
0
|
1
|
|
return undef; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub set_validity { |
89
|
|
|
|
|
|
|
#my Cache::Null::Entry $self = shift; |
90
|
0
|
|
|
0
|
1
|
|
return; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; |
95
|
|
|
|
|
|
|
__END__ |