| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package TM::Materialized::MLDBM; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2583
|
use TM; |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
73
|
|
|
4
|
1
|
|
|
1
|
|
9
|
use base qw (TM); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
104
|
|
|
5
|
1
|
|
|
1
|
|
464
|
use Class::Trait qw(TM::Synchronizable::MLDBM); |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=pod |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
TM::Materialized::MLDBM - Topic Maps, DBM Storage (asynchronous) |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use TM::Materialized::MLDBM; |
|
16
|
|
|
|
|
|
|
my $tm = new TM::Materialized::MLDBM (file => '/tmp/map.dbm'); |
|
17
|
|
|
|
|
|
|
# modify the map here..... |
|
18
|
|
|
|
|
|
|
# and flush everything onto the file |
|
19
|
|
|
|
|
|
|
$tm->sync_out; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# later in this game, get it back from file |
|
22
|
|
|
|
|
|
|
my $tm2 = new TM::Materialized::MLDBM (file => '/tmp/map.dbm'); |
|
23
|
|
|
|
|
|
|
$tm2->sync_in; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
This package just implements a materialized map with a MLDBM store. |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 INTERFACE |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head2 Constructor |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
The constructor expects to see the following option(s): |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=over |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=item B (no default) |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
The name of the DBM file. It is an error not to specify that. |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=item B (no default) |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Alternatively, this can be a C URL. |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub new { |
|
51
|
|
|
|
|
|
|
my $class = shift; |
|
52
|
|
|
|
|
|
|
my %options = @_; |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
if ($options{url}) { |
|
55
|
|
|
|
|
|
|
die "URL must have the protocol file: " unless $options{url} =~ /^file:/; |
|
56
|
|
|
|
|
|
|
return bless $class->SUPER::new (%options), $class; |
|
57
|
|
|
|
|
|
|
} else { |
|
58
|
|
|
|
|
|
|
my $file = delete $options{file} or $TM::log->logdie ("no file specified"); |
|
59
|
|
|
|
|
|
|
return bless $class->SUPER::new (%options, url => 'file:'.$file), $class; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=pod |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L, L |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR INFORMATION |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Copyright 200[6], Robert Barta , All rights reserved. |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it under the same terms as Perl |
|
74
|
|
|
|
|
|
|
itself. http://www.perl.com/perl/misc/Artistic.html |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
|
79
|
|
|
|
|
|
|
our $REVISION = '$Id: MLDBM.pm,v 1.5 2006/11/23 10:02:55 rho Exp $'; |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |