SUMO - Simulation of Urban MObility
TraCI_Junction.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2017-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 /****************************************************************************/
21 // C++ TraCI client API implementation
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
36 #include <microsim/MSNet.h>
38 #include "TraCI_Junction.h"
39 #include "TraCI.h"
40 
41 
42 // ===========================================================================
43 // member definitions
44 // ===========================================================================
45 std::vector<std::string>
47  std::vector<std::string> ids;
49  return ids;
50 }
51 
52 int
54  return (int) getIDList().size();
55 }
56 
58 TraCI_Junction::getPosition(const std::string& junctionID) {
59  return TraCI::makeTraCIPosition(getJunction(junctionID)->getPosition());
60 }
61 
63 TraCI_Junction::getShape(const std::string& junctionID) {
65 }
66 
68 TraCI_Junction::getJunction(const std::string& id) {
70  if (j == 0) {
71  throw TraCIException("Junction '" + id + "' is not known");
72  }
73  return j;
74 }
75 
76 
77 /****************************************************************************/
The base class for an intersection.
Definition: MSJunction.h:64
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
T get(const std::string &id) const
Retrieves an item.
static int getIDCount()
A 3D-position.
Definition: TraCIDefs.h:70
void insertIDs(std::vector< std::string > &into) const
static std::vector< std::string > getIDList()
static TraCIPositionVector makeTraCIPositionVector(const PositionVector &positionVector)
helper functions
Definition: TraCI.cpp:119
static TraCIPosition makeTraCIPosition(const Position &position)
Definition: TraCI.cpp:155
MSJunctionControl & getJunctionControl()
Returns the junctions control.
Definition: MSNet.h:389
static TraCIPositionVector getShape(const std::string &junctionID)
static TraCIPosition getPosition(const std::string &junctionID)
A list of positions.
static MSJunction * getJunction(const std::string &id)