#include <SModifier.h>
Inherited by SDimArrayMod, SEnvironmentMod, SJobMod, SPassiveMachinesMod, SPrecBrokerMod, SPrecRelationMod, STaskSystemMod, STopologyMod, and SVisPrecDAGMod.
Inheritance diagram for SModifier:
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 | |
SFlexLexer & | getLexer (std::istream &in) |
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 |
|
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.
|
|
Load from 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. |
|
|