SimModule Class Reference

SimModule is an extension of ModelComponent for simulation modules. More...

#include <Simulation/SimModule.H>

Inherits ModelComponent, SimCallbackClient, and SimReqHandlerClient.

Inherited by AttentionGate, AttentionGuidanceMap, Brain, Contours, CornersFeatures, EGMM, EyeHeadController, Ganglion, Geons2D, Geons3D, GistEstimator, GTEvaluator, HandController, ImageInfo, InferoTemporal, IT, LGN, LineFitting, LineGrouping, LineMatching, LocalParts, Objects, PCamera, PrefrontalCortex, Regions, Retina, SaccadeController, SaliencyMap, SFS, ShapeEstimator, SimEventBuffer, SimEventQueue, SimInputFrameSeries, SimOutputFrameSeries, SimulationViewer, SMap, SVMClassifierModule, TargetChecker, TaskRelevanceMap, TwoHalfDSketch, V1, V2, V4, V4d, VisualBuffer, VisualCortex, VisualCortex, VisualTracker, and WinnerTakeAll.

Collaboration diagram for SimModule:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SimModule (OptionManager &mgr, const std::string &descrName, const std::string &tagName)
 Constructor.
virtual ~SimModule ()
 Virtual destructor ensures proper destruction of derived classes.

Protected Member Functions

virtual void start1 ()
 This is called from within start() before the subcomponents start.

Detailed Description

SimModule is an extension of ModelComponent for simulation modules.

In addition to the base functionality inherited from ModelComponents, SimModule objects can post/check for SimEvent. This base class merely provides the interface.

PROGRAMMER NOTE: SimModule has ModelComponent as a virtual base. This is so that some classes can inherit from SimModule as well as from some other class which itself also virtually derives from ModelComponent, with sharing of the underlying ModelComponent virtual base.

The reason for this is for example that, at the time of this writing, VisualCortex derives from ComplexChannel which derives from ChannelBase which derives from ModelComponent. To make VisualCortex a SimModule (so that it can post SimEvents) would then require that ChannelBase derives from SimModule, which is not desirable since having an evolve() does not make sense for ChannelBase. So we would like to keep ChannelBase a standard ModelComponent (non-SimModule) while still making VisualCortex a SimModule. The solution is that VisualCortex should derive both from ComplexChannel and from SimModule. Since both ChannelBase and SimModule derive from ModelComponent, making that ModelComponent base virtual is necessary to avoid ending up with two ModelComponent objects inside VisualCortex.

Here is how to use this virtual base mechanism:

so, for example, what happens when you construct BlueChannel is:

BlueChannel constructor called First initialize virtual bases -> ModelComponent::ModelComponent() called. The ModelComponent part is left in a bogus uninitialized state except that const Impl* rep has been allocated.

Then initialize concrete bases -> SingleChannel constructor called In there, virtual bases already constructed, so move on to concrete ones -> ChannelBase constructor called

In there, virtual bases already constructed, so just initialize data members. Then in the { } of the constructor, ModelComponent::init() is called, which will fix the manager and names of the component. Those names will correctly be those passed down from the BlueChannel constructor.

same thing on the SimModule side: it virtually derives from ModelComponent and calls ModelComponent::init()

then when you construct, eg, SaliencyMap, first you get ModelComponent::ModelComponent() and later once the { } constructor code of SimModule runs, the call to init() will fix the component.

with multiple inheritance, eg VisualCortex derives from ComplexChannel and SimModule, pretty much the same thing happens, except that init() gets called twice, once from the ChannelBase c'tor and once from the SimModule c'tor... One way to avoid this would be to give a default c'tor to SimModule, but I'd rather not because things really become complicated then in case one does not know what he is doing (e.g., us 5 years from now) ;-)

Definition at line 123 of file SimModule.H.


Constructor & Destructor Documentation

SimModule::SimModule ( OptionManager mgr,
const std::string descrName,
const std::string tagName 
)

Constructor.

Definition at line 42 of file SimModule.C.

References ModelComponent::init().

SimModule::~SimModule (  )  [virtual]

Virtual destructor ensures proper destruction of derived classes.

Definition at line 50 of file SimModule.C.


Member Function Documentation

void SimModule::start1 (  )  [protected, virtual]

The documentation for this class was generated from the following files:
Generated on Sun May 8 08:25:20 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3