52 : myStorage(into), myTimeOffset(timeOffset), myTimeScale(timeScale),
53 myStartTime(startTime), myEndTime(endTime), myDetectorContainer(dets),
54 myHaveWarnedAboutOverridingBoundaries(false), myHaveWarnedAboutPartialDefs(false) {}
69 if (line.find(
';') == std::string::npos) {
80 if (parsedTime < myStartTime || parsedTime >=
myEndTime) {
83 WRITE_WARNING(
"At least one value lies beyond given time boundaries.");
112 WRITE_WARNING(
"At least one line does not contain the correct number of columns.");
117 +
" The following values must be supplied : 'Detector', 'Time', 'qPKW'\n" 118 +
" 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.
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.
std::string getFileName() const
Returns the name of the used file.
Retrieves a file linewise and reports the lines to a handler.
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
const RODFDetectorCon & myDetectorContainer
Container holding known detectors.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
RODFDetFlowLoader(const RODFDetectorCon &dets, RODFDetectorFlows &into, SUMOTime startTime, SUMOTime endTime, SUMOTime timeOffset, SUMOTime timeScale)
Constructor.
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.
bool know(const std::string &name) const
Returns the information whether the named column is known.
bool knows(const std::string &id) const
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.
const SUMOTime myTimeScale
The time scale to apply to read time values.
bool myHaveWarnedAboutPartialDefs
Whether a warning about partial definitions was already written.
void addFlow(const std::string &detector_id, SUMOTime timestamp, const FlowDef &fd)
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
NamedColumnsParser myLineHandler
The value extractor.
static double _2double(const E *const data)
converts a char-type array into the double value described by it
~RODFDetFlowLoader()
Destructor.
void parseLine(const std::string &line)
Parses the contents of the line.