line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pixie::Name; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
568
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION="2.06"; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
1
|
|
|
1
|
0
|
2
|
my $proto = shift; |
9
|
1
|
|
|
|
|
7
|
return bless {}, $proto; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub name_object_in { |
13
|
1
|
|
|
1
|
0
|
2
|
my $proto = shift; |
14
|
1
|
|
|
|
|
3
|
my($name,$obj,$pixie) = @_; |
15
|
1
|
|
|
|
|
3
|
$pixie->insert($proto->new->_oid("") |
16
|
|
|
|
|
|
|
->px_target($obj)); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub get_object_from { |
20
|
0
|
|
|
0
|
0
|
0
|
my $proto = shift; |
21
|
0
|
|
|
|
|
0
|
my($name, $pixie, $strategy) = @_; |
22
|
0
|
0
|
|
|
|
0
|
$proto->do_restoration( defined($strategy) ? |
23
|
|
|
|
|
|
|
$pixie |
24
|
|
|
|
|
|
|
->get_with_strategy("", $strategy) : |
25
|
|
|
|
|
|
|
$pixie->get("")); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub do_restoration { |
29
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
0
|
0
|
|
|
|
0
|
return unless my $name_obj = shift; |
32
|
0
|
|
|
|
|
0
|
my $target = $name_obj->px_target; |
33
|
0
|
0
|
|
|
|
0
|
if (wantarray) { |
34
|
0
|
0
|
|
|
|
0
|
return map { eval { $_->px_restore } || $_ } @$target; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
else { |
37
|
0
|
0
|
|
|
|
0
|
if ($target->[-1]->isa('Pixie::Proxy')) { |
38
|
0
|
|
|
|
|
0
|
return $target->[-1]->px_restore; |
39
|
0
|
|
|
|
|
0
|
} else { return $target->[-1]; } |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub get_object_from_with_strategy { |
44
|
0
|
|
|
0
|
0
|
0
|
my $proto = shift; |
45
|
0
|
|
|
|
|
0
|
my($name, $pixie, $strategy) = @_; |
46
|
0
|
|
|
|
|
0
|
$proto->do_restoration($pixie->get_with_strategy("", $strategy)); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub remove_name_from { |
50
|
0
|
|
|
0
|
0
|
0
|
my $proto = shift; |
51
|
0
|
|
|
|
|
0
|
my($name, $pixie) = @_; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
0
|
$pixie->delete(""); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _oid { |
57
|
2
|
|
|
2
|
|
6
|
my $self = shift; |
58
|
2
|
100
|
|
|
|
6
|
if (@_) { |
59
|
1
|
|
|
|
|
10
|
$self->{_oid} = shift; |
60
|
1
|
|
|
|
|
4
|
return $self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
else { |
63
|
1
|
|
|
|
|
5
|
return $self->{_oid}; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub px_target { |
68
|
1
|
|
|
1
|
0
|
4
|
my $self = shift; |
69
|
1
|
50
|
|
|
|
3
|
if (@_) { |
70
|
1
|
|
|
|
|
3
|
$self->{target} = shift; |
71
|
1
|
|
|
|
|
5
|
return $self; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
else { |
74
|
0
|
|
|
|
|
|
return $self->{target}; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |