NAME

Labrador::Common::Data

SYPNOPSIS

	use Labrador::Common::Data;
	my $data = new Labrador::Common::Data($config);
	$data->register_variable("AnArray", 'ARRAY', 1);
	my $array_ref = $data->obtain_variable("AnArray");

DESCRIPTION

This module is a generic global data store, supporting persistence.

NB: This module's API should be treated as unstable, as I intend to redesign it internally, so that separate subclasses can be created.

METHODS

new($config)

Constructs a new data object. Only parameter is an instance of the the config object,

register_array($name, $persistent)

Register an array for use

obtain_variable
register_variable($name, $type, $persistent)

Registers a variable for use. $type is one of 'ARRAY', 'HASH', 'SCALAR'. $persistent marks whether the contents of the variable should be stored on disk.

checkpoint

For all partially persistent data structures, updates the copy of the data structure on disk.

shutdown

Unties any persistent variables, so this object can be safely destroyed. Automatically calls checkpoint first.

PRIVATE METHODS

Should not be called directly

_tie_partial($name, $type)

Tie a partial persistent variable.

_untie_partial($name)

Unties a partially persistent variable.

_untie($name)

Unties a fully partitially persistent variable

_tie($name, $type, $ref)

Ties a fully persistent variable

_load_module($name)

Load the module called $name.

REVISION

$Revision: 1.10 $