44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
56 : myStorage(into), myTimeOffset(timeOffset), myTimeScale(timeScale),
57 myStartTime(startTime), myEndTime(endTime), myDetectorContainer(dets),
58 myHaveWarnedAboutOverridingBoundaries(false), myHaveWarnedAboutPartialDefs(false) {}
73 if (line.find(
';') == std::string::npos) {
83 if (time < myStartTime || time >
myEndTime) {
86 WRITE_WARNING(
"At least one value lies beyond given time boundaries.");
114 WRITE_WARNING(
"At least one line does not contain the correct number of columns.");
119 +
" The following values must be supplied : 'Detector', 'Time', 'qPKW'\n"
120 +
" The according column names must be given in the first line of the file.");
bool myHaveWarnedAboutOverridingBoundaries
Whether a warning about overriding boundaries was already written.
bool knows(const std::string &id) const
const SUMOTime myTimeOffset
The time offset to apply to read time values.
bool readLine(LineHandler &lh)
Reads a single (the next) line from the file and reports it to the given LineHandler.
static SUMOReal _2SUMOReal(const E *const data)
Retrieves a file linewise and reports the lines to a handler.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
const RODFDetectorCon & myDetectorContainer
Container holding known detectors.
A container for RODFDetectors.
#define WRITE_WARNING(msg)
RODFDetectorFlows & myStorage
The container for read detector values.
void reinit(const std::string &def, const std::string &defDelim=";", const std::string &lineDelim=";", bool chomp=false, bool ignoreCase=true)
Reinitialises the parser.
RODFDetFlowLoader(const RODFDetectorCon &dets, RODFDetectorFlows &into, SUMOTime startTime, SUMOTime endTime, SUMOTime timeOffset, int timeScale)
Constructor.
void read(const std::string &file)
Reads the given file assuming it contains detector values.
Definition of the traffic during a certain time containing the flows and speeds.
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
const SUMOTime myTimeScale
The time scale to apply to read time values.
bool myHaveWarnedAboutPartialDefs
Whether a warning about partial definitions was already written.
std::string getFileName() const
Returns the name of the used file.
bool know(const std::string &name) const
Returns the information whether the named column is known.
static int _2int(const E *const data)
void addFlow(const std::string &detector_id, SUMOTime timestamp, const FlowDef &fd)
NamedColumnsParser myLineHandler
The value extractor.
~RODFDetFlowLoader()
Destructor.
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
void parseLine(const std::string &line)
Parses the contents of the line.