Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

ModuleManager Class Reference

#include <module.h>

Collaboration diagram for ModuleManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manages loadable modules The module manager keeps track of search paths for modules and the loaded modules for quick access. An object wanting to load a module should do so through a ModuleManager interface, preferrably the module manager in the core object.

Author:
Cody Russell (cody [at] jhu.edu)


Public Member Functions

 ModuleManager ()
virtual ~ModuleManager ()
bool AddSearchPath (const HashString &rstrPath, bool bForce=false)
void RemoveSearchPath (const HashString &rstrPath)
virtual ModulePtr LoadModule (const HashString &rstrName)
virtual void InsertModule (Module *pkModule)
virtual void RemoveModule (Module *pkModule, bool bDeleted=false)

Protected Member Functions

bool PathExists (const HashString &rstrPath)

Protected Attributes

std::vector< HashStringm_vstrSearchPaths
HashTable< Modulem_hashModules


Constructor & Destructor Documentation

ModuleManager  ) 
 

Startup the module manager

virtual ~ModuleManager  )  [virtual]
 

Shutdown the module manager, free existing modules


Member Function Documentation

bool PathExists const HashString rstrPath  )  [protected]
 

Check to see if the given path exists.

Parameters:
rstrPath The path to check.

bool AddSearchPath const HashString rstrPath,
bool  bForce = false
 

Adds a search path for modules

Parameters:
rstrPath Directory path to add
bForce Force adding of the path, even if it doesn't exist?
Returns:
Whether the path existed. If bForce is false and the return value is false, the path was not added.

void RemoveSearchPath const HashString rstrPath  ) 
 

Removes a search path from the manager

Parameters:
rstrPath Directory path to remove

virtual ModulePtr LoadModule const HashString rstrName  )  [virtual]
 

Gets an Module reference for the named module. If the module has already been loaded, get a reference to it, otherwise try to load it first.

Parameters:
rstrName Name of the module requested.
Returns:
A reference to the requested module, if it could be obtained.

virtual void InsertModule Module pkModule  )  [virtual]
 

Manually insert a (statically) linked module

Parameters:
pkModule Module object

virtual void RemoveModule Module pkModule,
bool  bDeleted = false
[virtual]
 

Unregister a module

Parameters:
pkModule Module object
bDeleted true if module already deleted, or in dtor chain


Member Data Documentation

std::vector< HashString > m_vstrSearchPaths [protected]
 

List of search paths

HashTable< Module > m_hashModules [protected]
 

Hash table of loaded modules


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:12 2004 for NeoEngine by doxygen 1.3.5