SUMO - Simulation of Urban MObility
NIVissimSingleTypeParser_Simdauer.cpp
Go to the documentation of this file.
00001 /****************************************************************************/
00009 //
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 /****************************************************************************/
00014 //
00015 //   This file is part of SUMO.
00016 //   SUMO is free software: you can redistribute it and/or modify
00017 //   it under the terms of the GNU General Public License as published by
00018 //   the Free Software Foundation, either version 3 of the License, or
00019 //   (at your option) any later version.
00020 //
00021 /****************************************************************************/
00022 
00023 
00024 // ===========================================================================
00025 // included modules
00026 // ===========================================================================
00027 #ifdef _MSC_VER
00028 #include <windows_config.h>
00029 #else
00030 #include <config.h>
00031 #endif
00032 
00033 #include <iostream>
00034 #include <utils/common/TplConvert.h>
00035 #include <utils/common/MsgHandler.h>
00036 #include "../NIImporter_Vissim.h"
00037 #include "NIVissimSingleTypeParser_Simdauer.h"
00038 
00039 #ifdef CHECK_MEMORY_LEAKS
00040 #include <foreign/nvwa/debug_new.h>
00041 #endif // CHECK_MEMORY_LEAKS
00042 
00043 
00044 // ===========================================================================
00045 // method definitions
00046 // ===========================================================================
00047 NIVissimSingleTypeParser_Simdauer::NIVissimSingleTypeParser_Simdauer(NIImporter_Vissim& parent)
00048     : NIImporter_Vissim::VissimSingleTypeParser(parent) {}
00049 
00050 
00051 NIVissimSingleTypeParser_Simdauer::~NIVissimSingleTypeParser_Simdauer() {}
00052 
00053 
00054 bool
00055 NIVissimSingleTypeParser_Simdauer::parse(std::istream& from) {
00056     std::string duration;
00057     from >> duration;
00058     // !!!
00059     try {
00060         TplConvert<char>::_2SUMOReal(duration.c_str());
00061     } catch (...) {
00062         WRITE_ERROR("Simulation duration could not be parsed");
00063         return false;
00064     }
00065     return true;
00066 }
00067 
00068 
00069 
00070 /****************************************************************************/
00071 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines