SourceForge Logo

NAME

Boucherot::PluginManager - A set of instance of Boucherot's Plugin

SYNOPSIS

  use Boucherot::PluginManager;
  use Boucherot::Plugin::MyPlugin;

  my $plug=new Boucherot::Plugin::MyPlugin

  # $plug has auto-registred it-self to the PluginManager
  my $pm=new Boucherot::PluginManager;

  # list of all plugins
  $pm->list

  # remove all plugins that from a class
  $pm->removeall("Boucherot::Plugin::MyPlugin");

DESCRIPTION

This class is a plugin manager.

A plugin manager is a class that maintain a list of all plugins instances.

The PluginManager is not the ModuleManager. The ModuleManager may contains some instance of any module. The PluginManager contains only Plugin, but also all Plugins.

And All plugins registered to the PluginManager are also registered with the ModuleManager.

GISSUML MODEL

class Boucherot::PluginManager

Attributs:

 -$ instance    : Boucherot::PluginManager
 -  plugins : { 
      mid1 => { 
        "context" => context1 : SCALAR, 
        "chan" => chan1 : SCALAR 
        "mid" => mid1 : SCALAR 
        "class" => class1 : SCALAR 
      } 
      , ... 
    }

Methods:

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

METHODS

new

 +$ new () : Boucherot::ModuleManager

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

get

 +  get ( mid : SCALAR ) : Plugin

Return a given plugin.

list

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

return the list of all plugins.

add

 +  add ( plugin : UNIVERSAL ) : SCALAR

add a new plugin. Return the instance's mid.

remove

 +  remove ( mid : SCALAR ) :

remove an instance.

removeall

 +  removeall ( class : SCALAR ) :

remove all instances of a given plugin.

AUTHORS

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

NOTES

This class is part of the Boucherot project.