Algorithm::SpatialIndex::Storage - Base class for storage backends
use Algorithm::SpatialIndex; my $idx = Algorithm::SpatialIndex->new( storage => 'Memory', # or others );
Constructor. Called by the Algorithm::SpatialIndex constructor. You probably do not need to call or implement this. Calls your init method if available.
init
If your subcass implements this, it will be called on the fresh object in the constructor.
Fetch a node from storage by node id.
Has to be implemented in a subclass.
Store the provided node. Assigns a new ID to it if it has none. Returns the (potentially new) node id.
Note that general id handling is the task of the storage backend. Users or strategies should not set node ids.
Takes a key/value pair for a tree property/option to be stored.
Takes a key for a tree property/option to be fetched from storage.
Takes a node id as argument and returns the bucket for this node (or undef on failure).
Takes a bucket object (with assigned node id) and stores the bucket as the bucket for this node id.
Removes the given bucket (or bucket/node id) from the storage.
Steffen Mueller, <smueller@cpan.org>
Copyright (C) 2010, 2011 by Steffen Mueller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
To install Algorithm::SpatialIndex, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::SpatialIndex
CPAN shell
perl -MCPAN -e shell install Algorithm::SpatialIndex
For more information on module installation, please visit the detailed CPAN module installation guide.