SourceForge Logo

NAME

Boucherot::ModuleManager - A set of instance of Boucherot's Modules

SYNOPSIS

        use Boucherot::ModuleManager;
        my $mm=new Boucherot::ModuleManager;

        # ...

        # Foo::Bar is "ModuleManager" compatible.
        my $module=new Foo::Bar;

        $mm->add($module);

        printf "The module unique ID is %s\n",$module->mid;

        my $mid=$module->mid;

        $module2=$mm->get($mid);

        # Here $module2 eq $module

DESCRIPTION

This class is a module manager.

All instances of modules that are registred to the ModuleManager must be used only by storing the module id, and not by storing a reference on the module.

That mean, by removing the module from the module manager, the instance is destroyed.

The ModuleManager don't know the classes. It only know they can ``mid'' (as method)

GISSUML MODEL

class Boucherot::ModuleManager

Attributs:

 -$ instance    : Boucherot::ModuleManager
 -  modules     : {
                    mid => {
                      module : 
                    } : Hash,
                    ...
                  } : Hash
 -  next_mid   : SCALAR

Methods:

 +$ new () : Boucherot::ModuleManager
   Read
 +  get ( mid : SCALAR ) : UNIVERSAL 
 +  list () : { mid1 => class1 : SCALAR , ... }
   Write
 +  add ( module : UNIVERSAL ) : SCALAR
 +  remove ( mid : SCALAR ) :

METHODS

new

 +$ new () : Boucherot::ModuleManager

Constructor. It takes no arguments, and return a module manager

get

 +  get ( mid : SCALAR ) : UNIVERSAL

Get an object from it's ``mid''.

list

 +  list () : { mid1 => class1 : SCALAR , ... }

List all the mid.

add

 +  add ( module : UNIVERSAL ) : SCALAR

Add a new object to the manager.

remove

 +  remove ( mid : SCALAR ) :

Remove an existing object from the manager.

AUTHORS

This class was written by Arthibus Gissehel <gissehel@vachefolle.com> in 2001.

NOTES

This class is part of the Boucherot project.