line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
1384
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
2
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
75
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Data::Remember::POE; |
5
|
|
|
|
|
|
|
{ |
6
|
|
|
|
|
|
|
$Data::Remember::POE::VERSION = '0.140490'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
# ABSTRACT: a brain for Data::Remember linked to the POE session heap |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Data::Remember::Util |
11
|
1
|
|
|
1
|
|
6
|
init_brain => { -as => '_init_brain' }; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
1
|
|
|
1
|
1
|
3
|
my $class = shift; |
16
|
1
|
|
|
|
|
4
|
my @config = @_; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
8
|
return bless { config => \@config }, $class; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new_heap { |
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
my @config = scalar(@_) ? @_ : @{ $self->{config} }; |
|
0
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return _init_brain(@config); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub remember { |
32
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
33
|
0
|
|
|
|
|
|
my $que = shift; |
34
|
0
|
|
|
|
|
|
my $fact = shift; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
return POE::Kernel->get_active_session->get_heap->remember($que, $fact); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub recall { |
41
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
42
|
0
|
|
|
|
|
|
my $que = shift; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
return POE::Kernel->get_active_session->get_heap->recall($que); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub forget { |
49
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
50
|
0
|
|
|
|
|
|
my $que = shift; |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return POE::Kernel->get_active_session->get_heap->forget($que); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub brain { |
57
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
58
|
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
return POE::Kernel->get_active_session->get_heap; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |