NAME
Geo::GPS::Data::Storage - Generic storage mechanism manager for the perl-GPSData package.
SYNOPSIS
use Geo::GPS::Data::Storage;
my %href = (
storage => 'MySQL',
storage_params => {
database => 'gpsdata',
host => 'localhost',
username => 'gpsuser',
password => 'mypasswd',
}
);
my $store_object = Geo::GPS::Data::Storage->new([\%href]);
DESCRIPTION
This class acts as a sort of multiplexer, choosing which storage class to instantiate based on the parameters given and returning an object of the right class. It also acts as a template providing the names of methods the subclasses are required to implement.
Class Methods
- new()
-
Creates an object of the right subclass (according to the parameters) and returns it.
Tha parameters are passed as an hash reference and are as follows:
- storage
-
The storage type you wish to use for the data you are going to manipulate. At this time two classes of storage exist:
- RAM
-
Totally volatile, usefull mainly for testing and debugging; This storage class takes no other parameters.
- MySQL
-
You need to have a mysql database setup properly for this storage method to work. Look in the distribution (probably under the goodies directory) for the schema for the database. This storage class takes an optional set of parameters described below.
- storage_params
-
Usefull to configure a storage class that takes parameters.
For the list of required and optional parameters please look into the relevant Geo::GPS::Data::Storage::* class' documentation.
- waypoint_types()
-
A method that all sublclasses must implement. This method returns a list of the supported waypoint types for this storage class.
- store_waypoint()
-
A method that all sublclasses must implement. This method stores a waypoint.
- retrieve_waypoint()
-
A method that all sublclasses must implement. This method retrieves a waypoint's information from storage.
- delete_waypoint()
-
A method that all sublclasses must implement. This method permanently deletes a waypont's information from storage.
- exists_waypoint()
-
A method that all sublclasses must implement. This method checks if a given waypoint exists in storage.
- store_collection()
-
A method that all sublclasses must implement. This method stores information about a collection of waypoints.
- retrieve_collection()
-
A method that all sublclasses must implement. This method retrieves the information about a waypoint collection from storage.
- delete_collection()
-
A method that all sublclasses must implement. This method permanently deletes a waypont collection's information from storage.
- exists_collection()
-
A method that all sublclasses must implement. This method checks if a given waypoint existon in storage.
AUTHOR
Nuno Nunes, <nfmnunes@cpan.org>
SEE ALSO
Geo::GPS::Data, Geo::GPS::Data::Storage::RAM, Geo::GPS::Data::Storage::MySQL.