line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tree::Persist; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
108160
|
use strict; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
180
|
|
4
|
6
|
|
|
6
|
|
21
|
use warnings; |
|
6
|
|
|
|
|
5
|
|
|
6
|
|
|
|
|
172
|
|
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
2623
|
use Module::Runtime; |
|
6
|
|
|
|
|
7143
|
|
|
6
|
|
|
|
|
32
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.11'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ---------------------------------------------- |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub connect |
13
|
|
|
|
|
|
|
{ |
14
|
6
|
|
|
6
|
1
|
13349
|
my($class) = shift; |
15
|
6
|
|
|
|
|
16
|
my($obj) = $class -> _instantiate( @_ ); |
16
|
|
|
|
|
|
|
|
17
|
6
|
|
|
|
|
12
|
$obj -> _reload; |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
|
|
14
|
return $obj; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
} # End of connect. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# ---------------------------------------------- |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub create_datastore |
26
|
|
|
|
|
|
|
{ |
27
|
4
|
|
|
4
|
1
|
370025
|
my($class) = shift; |
28
|
4
|
|
|
|
|
12
|
my($obj) = $class -> _instantiate( @_ ); |
29
|
|
|
|
|
|
|
|
30
|
4
|
|
|
|
|
9
|
$obj -> _create; |
31
|
|
|
|
|
|
|
|
32
|
4
|
|
|
|
|
13
|
return $obj; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
} # End of create_datastore. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ---------------------------------------------- |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _instantiate |
39
|
|
|
|
|
|
|
{ |
40
|
10
|
|
|
10
|
|
13
|
my($self) = shift; |
41
|
10
|
|
|
|
|
12
|
my($opts) = @_; |
42
|
10
|
|
|
|
|
24
|
my($class) = delete $$opts{class}; |
43
|
10
|
|
|
|
|
13
|
my($type) = delete $$opts{type}; |
44
|
|
|
|
|
|
|
|
45
|
10
|
100
|
|
|
|
26
|
if (! $class) |
46
|
|
|
|
|
|
|
{ |
47
|
9
|
50
|
|
|
|
21
|
$type = 'File' if (! $type); |
48
|
9
|
50
|
|
|
|
22
|
$class = $type eq 'File' ? 'Tree::Persist::File::XML' : 'Tree::Persist::DB::SelfReferential'; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
10
|
|
|
|
|
24
|
return Module::Runtime::use_module($class)->new( $opts ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
} # End of _instantiate. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# ---------------------------------------------- |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |