#include <MSTriggeredReader.h>

Definition at line 44 of file MSTriggeredReader.h.
Public Member Functions | |
| void | init () |
| bool | isInitialised () const |
| SUMOTime | wrappedExecute (SUMOTime current) throw (ProcessError) |
| virtual | ~MSTriggeredReader () |
| Destructor. | |
Protected Member Functions | |
| virtual void | inputEndReached ()=0 |
| MSTriggeredReader (MSNet &net) | |
| Constructor (for an abstract class). | |
| virtual void | myInit ()=0 |
| virtual bool | processNextEntryReaderTriggered ()=0 |
| Processes the next event Returns true if the next element shall be read (a new timestemp is then available also) Returns false if the action could not be accomplished; this method is then called in the next step again. | |
| virtual bool | readNextTriggered ()=0 |
| Reads from the file. | |
| SUMOTime | warppedExecute (SUMOTime currentTime) throw (ProcessError) |
Protected Attributes | |
| SUMOTime | myOffset |
| The offset to the next event. | |
| bool | myWasInitialised |
Private Member Functions | |
| MSTriggeredReader (const MSTriggeredReader &) | |
| Invalidated copy constructor. | |
| MSTriggeredReader & | operator= (const MSTriggeredReader &) |
| Invalidated assignment operator. | |
| MSTriggeredReader::~MSTriggeredReader | ( | ) | [virtual] |
| MSTriggeredReader::MSTriggeredReader | ( | MSNet & | net | ) | [protected] |
Constructor (for an abstract class).
Definition at line 41 of file MSTriggeredReader.cpp.
00042 : myOffset(0), myWasInitialised(false) {}
| MSTriggeredReader::MSTriggeredReader | ( | const MSTriggeredReader & | ) | [private] |
Invalidated copy constructor.
| void MSTriggeredReader::init | ( | ) |
Definition at line 49 of file MSTriggeredReader.cpp.
References myInit(), and myWasInitialised.
Referenced by wrappedExecute(), and GUIEmitter::GUIEmitterChild_UserTriggeredChild::wrappedExecute().
00049 { 00050 myInit(); 00051 myWasInitialised = true; 00052 }
| virtual void MSTriggeredReader::inputEndReached | ( | ) | [protected, pure virtual] |
Implemented in MSCalibrator::MSCalibrator_FileTriggeredChild, and MSEmitter::MSEmitter_FileTriggeredChild.
| bool MSTriggeredReader::isInitialised | ( | ) | const |
Definition at line 56 of file MSTriggeredReader.cpp.
References myWasInitialised.
Referenced by wrappedExecute(), and GUIEmitter::GUIEmitterChild_UserTriggeredChild::wrappedExecute().
00056 { 00057 return myWasInitialised; 00058 }
| virtual void MSTriggeredReader::myInit | ( | ) | [protected, pure virtual] |
| MSTriggeredReader& MSTriggeredReader::operator= | ( | const MSTriggeredReader & | ) | [private] |
Invalidated assignment operator.
| virtual bool MSTriggeredReader::processNextEntryReaderTriggered | ( | ) | [protected, pure virtual] |
Processes the next event Returns true if the next element shall be read (a new timestemp is then available also) Returns false if the action could not be accomplished; this method is then called in the next step again.
Implemented in MSCalibrator::MSCalibrator_FileTriggeredChild, and MSEmitter::MSEmitter_FileTriggeredChild.
Referenced by wrappedExecute().
| virtual bool MSTriggeredReader::readNextTriggered | ( | ) | [protected, pure virtual] |
| SUMOTime MSTriggeredReader::warppedExecute | ( | SUMOTime | currentTime | ) | throw (ProcessError) [protected] |
| SUMOTime MSTriggeredReader::wrappedExecute | ( | SUMOTime | current | ) | throw (ProcessError) |
Definition at line 62 of file MSTriggeredReader.cpp.
References DELTA_T, init(), isInitialised(), myOffset, processNextEntryReaderTriggered(), and readNextTriggered().
Referenced by MSTriggeredXMLReader::MSTriggeredXMLReader().
00062 { 00063 if (!isInitialised()) { 00064 init(); 00065 } 00066 SUMOTime next = current; 00067 // loop until the next action lies in the future 00068 while (current==next) { 00069 // run the next action 00070 // if it could be accomplished... 00071 if (processNextEntryReaderTriggered()) { 00072 // read the next one 00073 if (readNextTriggered()) { 00074 // set the time for comparison if a next one exists 00075 next = myOffset; 00076 } else { 00077 // leave if no further exists 00078 return 0; 00079 } 00080 } else { 00081 // action could not been accomplished; try next time step 00082 return DELTA_T; 00083 } 00084 } 00085 // come back if the next action shall be executed 00086 if (myOffset - current<=0) { 00087 // current is delayed; 00088 return DELTA_T; 00089 } 00090 return myOffset - current; 00091 }
SUMOTime MSTriggeredReader::myOffset [protected] |
The offset to the next event.
Definition at line 73 of file MSTriggeredReader.h.
Referenced by MSEmitter::MSEmitter_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSCalibrator::MSCalibrator_FileTriggeredChild::buildAndScheduleFlowVehicle(), MSTriggeredXMLReader::myInit(), MSEmitter::MSEmitter_FileTriggeredChild::myStartElement(), MSCalibrator::MSCalibrator_FileTriggeredChild::myStartElement(), and wrappedExecute().
bool MSTriggeredReader::myWasInitialised [protected] |
1.5.6