Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

SModifier Class Reference

#include <SModifier.h>

Inherited by SDimArrayMod, SEnvironmentMod, SJobMod, SPassiveMachinesMod, SPrecBrokerMod, SPrecRelationMod, STaskSystemMod, STopologyMod, and SVisPrecDAGMod.

Inheritance diagram for SModifier:

Inheritance graph
[legend]
List of all members.

Public Methods

 SModifier ()
virtual ~SModifier ()
virtual bool load (std::istream &in)=0
virtual void save (std::ostream &out) const=0
virtual void sample ()

Protected Methods

SFlexLexergetLexer (std::istream &in)

Detailed Description

Superclass for the classes which are used to load/modify the STaskSystem and all its components. Each class with a persistent state has a corresponding ...Mod-class, which is responsible for the modification of this persistent state. The lifetime of a modifier and its corresponding object is identical.

All other methods which concern the non-persistent state are in the classes themselves, e.g. schedule() in the STaskSystem

Purpose of this design: -----------------------

the class hierarchies of the task system classes don't match the class hierarchies which would be suitable for the construction methods: For example the most general environment (SUnrelated) should provide a method which sets the speed for a specific pair machine/job whereas for the derived class SUniform this does not make sense. In order to keep these methods out of the interfaces of the task system classes an independent hierarchy of modifier-classes is introduced.

Drawback of this approach: --------------------------

Down-casts are required to access the corresponding modifier to a specific object. We believe that this does not cause too many problems because these down-casts are only executed in the core of the system (i.e., not by external users of the library) and the classes which modify other classes should exactly know what kind of object they are modifying.

Implementation: ---------------

Every (non-abstract) class has a private member of its corresponding modifier-class, which can be accessed via a virtual getModifier()-method. This method is defined at the top of each class hierarchy (in SEnvironment, SJob, ...). The modifiers are connected to their corresponding objects by references. Those references are set in the constructors of the modifier-classes.

In order to avoid cyclic dependencies the methods in the modifiers-classes should not be inlined. Then a simple forward declaration of SFoo suffices in SFooMod.h. The modifier member variables are called _mod.


Constructor & Destructor Documentation

SModifier::SModifier   [inline]
 

Constructor

virtual SModifier::~SModifier   [inline, virtual]
 

Destructor


Member Function Documentation

SFlexLexer & SModifier::getLexer std::istream &    in [protected]
 

Get a reference to the global lexical-analyzer, in order to parse an input stream. There is only one lexer for all modifiers in the tasksystem to avoid wasting space. When the input stream is switched, the current line number is set to 1.

Parameters:
in  input stream

virtual bool SModifier::load std::istream &    in [pure virtual]
 

Load from stream

Parameters:
in  input stream
Returns:
true if successfull, otherwise false

Implemented in SBroadcastMod, SFlowShopMod, SIdenticalMod, SJobShopMod, SOpenShopMod, SUniformMod, SUnrelatedMod, SAtomarJobMod, SBroadcastRequMod, SJobMod, SMalleableJobMod, SParallelJobMod, SShopJobMod, SMachinesMod, SPassiveMachinesMod, SPrecBrokerMod, SPrecDAGMod, STaskSystemMod, SVisPrecDAGMod, SDimArrayMod, SHypercubeMod, SLineTopologyMod, SMeshNMod, SMeshTopologyMod, SSetTopologyMod, and SSingleTopologyMod.

virtual void SModifier::sample   [inline, virtual]
 

Reimplemented in SBroadcastMod, SIdenticalMod, SOpenShopMod, SUniformMod, SUnrelatedMod, SAtomarJobMod, SBroadcastRequMod, SMalleableJobMod, SParallelJobMod, SShopJobMod, SPrecBrokerMod, SPrecDAGMod, STaskSystemMod, SDimArrayMod, SHypercubeMod, SLineTopologyMod, SMeshNMod, SMeshTopologyMod, SSetTopologyMod, and SSingleTopologyMod.

virtual void SModifier::save std::ostream &    out const [pure virtual]
 

Save to stream

Implemented in SBroadcastMod, SFlowShopMod, SIdenticalMod, SJobShopMod, SOpenShopMod, SUniformMod, SUnrelatedMod, SAtomarJobMod, SBroadcastRequMod, SJobMod, SMalleableJobMod, SParallelJobMod, SShopJobMod, SMachinesMod, SPassiveMachinesMod, SPrecBrokerMod, SPrecDAGMod, STaskSystemMod, SVisPrecDAGMod, SDimArrayMod, SHypercubeMod, SLineTopologyMod, SMeshNMod, SMeshTopologyMod, SSetTopologyMod, and SSingleTopologyMod.


The documentation for this class was generated from the following files:
Generated on Thu May 22 16:50:50 2003 for Sketch-it! by doxygen1.2.18