ModuleLoader Class Reference

Manage the loading of modules. More...

#include <moduleloader.h>

List of all members.

Public Member Functions

 ModuleLoader ()
void addModule (const std::string &key, Module *module)
 Add a module and register its format detection methods.
void setDirectories (const std::vector< std::string > &directories, const ProgramLoader &programLoader)
 Generate and add HMDL modules from directories.
void refreshDirectories (const ProgramLoader &programLoader)
 Refresh.
const ModulegetModule (const std::string &key) const
 Give constant access to a module and loads it has not yet been loaded.
const ModulegetModule (File &file) const
 Give constant access to a module able to handle the file and loads it has not yet been loaded.

Detailed Description

Manage the loading of modules.

When a module is added the module loader register the format detection methods for the module (see Module::addFormatDetection). Then when a file needs to be parsed the module loader uses its format detector to choose which module to assign.

When a module is needed, the module loader ask for requested modules to import (see Module::requestImportations), load them, import them to the module and then loads the module itself (see Module::doLoad).


Constructor & Destructor Documentation


Member Function Documentation

void ModuleLoader::addModule ( const std::string &  key,
Module module 
)

Add a module and register its format detection methods.

Parameters:
keyunique identifier for the module, used to load a module explicitly or request importations.
moduleA pointer to the module is given and the ModuleLoader takes ownership of the module, the module is then destroyed when the module loader itself is destroyed.
const Module& ModuleLoader::getModule ( const std::string &  key) const

Give constant access to a module and loads it has not yet been loaded.

const Module& ModuleLoader::getModule ( File file) const

Give constant access to a module able to handle the file and loads it has not yet been loaded.

the module loader uses its format detector to choose which module to assign

void ModuleLoader::refreshDirectories ( const ProgramLoader programLoader)

Refresh.

void ModuleLoader::setDirectories ( const std::vector< std::string > &  directories,
const ProgramLoader programLoader 
)

Generate and add HMDL modules from directories.

The key for the module are the name of the files (extension excluded)

The files are compiled again only if the compiled file is less recent than the original file


The documentation for this class was generated from the following file: