line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
707
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
3
|
|
|
|
|
|
|
package Mixin::Historian::Driver::Array; |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
$Mixin::Historian::Driver::Array::VERSION = '0.102000'; |
6
|
|
|
|
|
|
|
} |
7
|
1
|
|
|
1
|
|
14
|
use base 'Mixin::Historian::Driver'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
515
|
|
8
|
|
|
|
|
|
|
# ABSTRACT: a driver that stores history in an in-memory array (for testing) |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
1
|
|
|
1
|
0
|
38
|
my ($class, $arg) = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
43
|
return bless { |
15
|
|
|
|
|
|
|
array => [], |
16
|
|
|
|
|
|
|
} => $class; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _array { |
20
|
3
|
|
|
3
|
|
38
|
$_[0]{array}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub entries { |
24
|
1
|
|
|
1
|
0
|
6
|
my ($self) = @_; |
25
|
1
|
|
|
|
|
3
|
return @{ $self->_array }; |
|
1
|
|
|
|
|
3
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub add_history { |
29
|
2
|
|
|
2
|
0
|
3
|
my ($self, $arg) = @_; |
30
|
|
|
|
|
|
|
|
31
|
2
|
|
|
|
|
5
|
my $record = $arg->{args}[0]; |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
|
|
3
|
push @{ $self->_array }, { |
|
2
|
|
|
|
|
6
|
|
34
|
|
|
|
|
|
|
time => time, |
35
|
|
|
|
|
|
|
record => $record, |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |