SUMO - Simulation of Urban MObility
Junction.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2012-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // C++ TraCI client API implementation
18 /****************************************************************************/
19 #ifndef Junction_h
20 #define Junction_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <vector>
29 #include <libsumo/TraCIDefs.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
36 class NamedRTree;
37 class MSJunction;
38 class PositionVector;
39 namespace libsumo {
40 class VariableWrapper;
41 }
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
51 namespace libsumo {
52 class Junction {
53 public:
54  static std::vector<std::string> getIDList();
55  static int getIDCount();
56  static TraCIPosition getPosition(const std::string& junctionID, const bool includeZ = false);
57  static TraCIPositionVector getShape(const std::string& junctionID);
58 
60 
64  static NamedRTree* getTree();
65 
70  static void storeShape(const std::string& id, PositionVector& shape);
71 
72  static std::shared_ptr<VariableWrapper> makeWrapper();
73 
74  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper);
75 
76 private:
77  static MSJunction* getJunction(const std::string& id);
78 
79 private:
82 
83 private:
85  Junction() = delete;
86 };
87 }
88 
89 
90 #endif
91 
92 /****************************************************************************/
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:199
static int getIDCount()
Definition: Junction.cpp:57
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:44
The base class for an intersection.
Definition: MSJunction.h:61
A RT-tree for efficient storing of SUMO&#39;s Named objects.
Definition: NamedRTree.h:65
static LIBSUMO_SUBSCRIPTION_API NamedRTree * getTree()
Returns a tree filled with junction instances.
Definition: Junction.cpp:88
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:200
static MSJunction * getJunction(const std::string &id)
Definition: Junction.cpp:75
static TraCIPositionVector getShape(const std::string &junctionID)
Definition: Junction.cpp:69
A list of positions.
static std::shared_ptr< VariableWrapper > makeWrapper()
Definition: Junction.cpp:107
static TraCIPosition getPosition(const std::string &junctionID, const bool includeZ=false)
Definition: Junction.cpp:63
Junction()=delete
invalidated standard constructor
Definition: Edge.cpp:30
static void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
Definition: Junction.cpp:101
static ContextSubscriptionResults myContextSubscriptionResults
Definition: Junction.h:81
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
Definition: Junction.cpp:113
A 3D-position.
Definition: TraCIDefs.h:107
static std::vector< std::string > getIDList()
Definition: Junction.cpp:49
A list of positions.
static SubscriptionResults mySubscriptionResults
Definition: Junction.h:80