LRAUV  revA
Module Class Referenceabstract

Module is the abstract base class for a collection of Component objects that can be contained in a loadable module. More...

#include <Module.h>

Inheritance diagram for Module:
Collaboration diagram for Module:

Public Member Functions

virtual ~Module ()
 destructor More...
 
virtual FlexArray< Component * > * getComponents ()
 returns a vector of components in the module More...
 
virtual const StrgetName () const
 returns the name of the module More...
 
virtual const StrgetDescription ()
 returns a description of the module More...
 
virtual void loadComponents (Logger &logger)=0
 loads the collection of components belonging to this module More...
 
void registerComponent (Component *comp)
 
void registerBehaviorCreator (const Str &creatorName, BehaviorCreator behaviorCreator)
 
void unregisterComponent (Component *comp)
 

Protected Member Functions

 Module (Str name, Str description)
 Protected constructor for abstract base class. More...
 
bool loadAtStartup (const ConfigURI &loadCfg, Logger &logger, bool forceIfMissing=false)
 

Protected Attributes

Str name_
 
Str description_
 
FlexArray< Component * > components_
 

Private Member Functions

 Module (const Module &old)
 

Detailed Description

Module is the abstract base class for a collection of Component objects that can be contained in a loadable module.

Typically, an implementation of Module will call: registerComponent( new MyComponent() ); for each Component in the module, except MissionComponents, which require a call to registerBehaviorCreator( MyComponentIF::NAME, &MyComponent::CreateBehavior ); for each Behavior.

Module implementations must implement:

  • extern "C" Module* create_module(), which just returns a "new" instance of the module
    –AND–
  • extern "C" void destroy(Module* module), which calls "delete" on the module object.

Constructor & Destructor Documentation

Module::~Module ( )
virtual
Module::Module ( Str  name,
Str  description 
)
protected

Protected constructor for abstract base class.

Module::Module ( const Module old)
private

Member Function Documentation

FlexArray< Component * > * Module::getComponents ( )
virtual

returns a vector of components in the module

returns a vector of components in the module

References components_.

const Str & Module::getDescription ( )
virtual

returns a description of the module

References description_.

Referenced by ModuleLoader::loadModule().

const Str & Module::getName ( void  ) const
virtual

returns the name of the module

References name_.

Referenced by Slate::ConfigureNewDataElement(), and ModuleLoader::loadModule().

virtual void Module::loadComponents ( Logger logger)
pure virtual
void Module::registerBehaviorCreator ( const Str creatorName,
BehaviorCreator  behaviorCreator 
)

Member Data Documentation

FlexArray<Component*> Module::components_
protected
Str Module::description_
protected

Referenced by getDescription().

Str Module::name_
protected

Referenced by getName().


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