Eclipse 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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // C++ TraCI client API implementation
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <vector>
26 #include <libsumo/TraCIDefs.h>
27 #include <libsumo/TraCIConstants.h>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 #ifndef LIBTRACI
34 class NamedRTree;
35 class MSJunction;
36 class PositionVector;
37 namespace LIBSUMO_NAMESPACE {
38 class VariableWrapper;
39 }
40 #endif
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 namespace LIBSUMO_NAMESPACE {
50 class Junction {
51 public:
52  static libsumo::TraCIPosition getPosition(const std::string& junctionID, bool includeZ = false);
53  static libsumo::TraCIPositionVector getShape(const std::string& junctionID);
54 
57 
58 #ifndef LIBTRACI
63  static void storeShape(const std::string& id, PositionVector& shape);
64 
68  static NamedRTree* getTree();
69  static void cleanup();
70 
71  static std::shared_ptr<VariableWrapper> makeWrapper();
72 
73  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper);
74 
75 private:
76  static MSJunction* getJunction(const std::string& id);
77 
78 private:
81  static NamedRTree* myTree;
82 #endif
83 private:
85  Junction() = delete;
86 };
87 }
#define LIBSUMO_ID_PARAMETER_API
Definition: TraCIDefs.h:97
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:44
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API void storeShape(const std::string &id, PositionVector &shape)
Saves the shape of the requested object in the given container.
static SubscriptionResults mySubscriptionResults
Definition: Junction.h:79
static libsumo::TraCIPositionVector getShape(const std::string &junctionID)
static NamedRTree * myTree
Definition: Junction.h:81
static std::shared_ptr< VariableWrapper > makeWrapper()
static libsumo::TraCIPosition getPosition(const std::string &junctionID, bool includeZ=false)
Junction()=delete
invalidated standard constructor
static NamedRTree * getTree()
Returns a tree filled with junction instances.
static ContextSubscriptionResults myContextSubscriptionResults
Definition: Junction.h:80
static MSJunction * getJunction(const std::string &id)
The base class for an intersection.
Definition: MSJunction.h:58
A RT-tree for efficient storing of SUMO's Named objects.
Definition: NamedRTree.h:60
A list of positions.
std::vector< TraCIPosition > TraCIPositionVector
Definition: TraCIDefs.h:196
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:250
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:251
A 3D-position.
Definition: TraCIDefs.h:141