SUMO - Simulation of Urban MObility
NIVissimSingleTypeParser_Kantensperrung.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 //
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
31 #include <iostream>
33 #include "../NIImporter_Vissim.h"
34 #include "../tempstructs/NIVissimClosures.h"
36 
37 
38 // ===========================================================================
39 // method definitions
40 // ===========================================================================
42  : NIImporter_Vissim::VissimSingleTypeParser(parent) {}
43 
44 
46 
47 
48 bool
50  std::string tag;
51  from >> tag;
52  //
53  std::string id;
54  from >> id;
55  //
56  from >> tag;
57  from >> tag;
58  int from_node;
59  from >> from_node;
60  //
61  from >> tag;
62  from >> tag;
63  int to_node;
64  from >> to_node;
65  //
66  from >> tag;
67  from >> tag;
68  std::vector<int> edges;
69  while (tag != "DATAEND") {
70  tag = readEndSecure(from);
71  if (tag != "DATAEND") {
72  edges.push_back(TplConvert::_2int(tag.c_str()));
73  }
74  }
75  NIVissimClosures::dictionary(id, from_node, to_node, edges);
76  return true;
77 }
78 
79 
80 
81 /****************************************************************************/
82 
static bool dictionary(const std::string &id, int from_node, int to_node, std::vector< int > &overEdges)
std::string readEndSecure(std::istream &from, const std::string &excl="")
as myRead, but returns "DATAEND" when the current field has ended
Importer for networks stored in Vissim format.
bool parse(std::istream &from)
Parses the data type from the given stream.
NIVissimSingleTypeParser_Kantensperrung(NIImporter_Vissim &parent)
Constructor.
static int _2int(const E *const data)
converts a char-type array into the integer value described by it
Definition: TplConvert.h:155