TM::Materialized::MLDBM - Topic Maps, DBM Storage (asynchronous)


TM documentation Contained in the TM distribution.

Index


Code Index:

NAME

Top

TM::Materialized::MLDBM - Topic Maps, DBM Storage (asynchronous)

SYNOPSIS

Top

    use TM::Materialized::MLDBM;
    my $tm = new TM::Materialized::MLDBM (file => '/tmp/map.dbm');
    # modify the map here.....
    # and flush everything onto the file
    $tm->sync_out;

    # later in this game, get it back from file
    my $tm2 = new TM::Materialized::MLDBM (file => '/tmp/map.dbm');
    $tm2->sync_in;




DESCRIPTION

Top

This package just implements a materialized map with a MLDBM store.

INTERFACE

Top

Constructor

The constructor expects to see the following option(s):

file (no default)

The name of the DBM file. It is an error not to specify that.

url (no default)

Alternatively, this can be a file: URL.

SEE ALSO

Top

TM, TM::Synchronizable::MLDBM

AUTHOR INFORMATION

Top

Copyright 200[6], Robert Barta <drrho@cpan.org>, All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. http://www.perl.com/perl/misc/Artistic.html


TM documentation Contained in the TM distribution.
package TM::Materialized::MLDBM;

use TM;
use base qw (TM);
use Class::Trait qw(TM::Synchronizable::MLDBM);

sub new {
    my $class = shift;
    my %options = @_;

    if ($options{url}) {
	die "URL must have the protocol file: " unless $options{url} =~ /^file:/;
	return bless $class->SUPER::new (%options), $class;
    } else {
	my $file = delete $options{file} or $TM::log->logdie ("no file specified");
	return bless $class->SUPER::new (%options, url => 'file:'.$file), $class;
    }
}

our $VERSION  = '0.02';
our $REVISION = '$Id: MLDBM.pm,v 1.5 2006/11/23 10:02:55 rho Exp $';

1;

__END__