SUMO - Simulation of Urban MObility
NIVissimSingleTypeParser_Simdauer.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 //
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <iostream>
36 #include "../NIImporter_Vissim.h"
38 
39 
40 // ===========================================================================
41 // method definitions
42 // ===========================================================================
44  : NIImporter_Vissim::VissimSingleTypeParser(parent) {}
45 
46 
48 
49 
50 bool
52  std::string duration;
53  from >> duration;
54  // !!!
55  try {
56  TplConvert::_2double(duration.c_str());
57  } catch (...) {
58  WRITE_ERROR("Simulation duration could not be parsed");
59  return false;
60  }
61  return true;
62 }
63 
64 
65 
66 /****************************************************************************/
67 
Importer for networks stored in Vissim format.
NIVissimSingleTypeParser_Simdauer(NIImporter_Vissim &parent)
Constructor.
bool parse(std::istream &from)
Parses the data type from the given stream.
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:206
static double _2double(const E *const data)
converts a char-type array into the double value described by it
Definition: TplConvert.h:297