line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TM::Serializable::Dumper; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1344
|
use Class::Trait 'base'; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
use Class::Trait 'TM::Serializable'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Data::Dumper; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub serialize { |
9
|
|
|
|
|
|
|
my $self = shift; |
10
|
|
|
|
|
|
|
use Data::Dumper; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $s; |
13
|
|
|
|
|
|
|
{ |
14
|
|
|
|
|
|
|
local $Data::Dumper::Purity = 1; |
15
|
|
|
|
|
|
|
$s = Data::Dumper->Dump ([$self], ['tm']); # NB: we have recursive data structures |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
return $s; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub deserialize { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
my $s = shift; |
23
|
|
|
|
|
|
|
my $tm; |
24
|
|
|
|
|
|
|
eval $s; |
25
|
|
|
|
|
|
|
$self->melt ($tm); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |