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-2022 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 <vector>
24 #include <libsumo/TraCIDefs.h>
25 #include <libsumo/TraCIConstants.h>
26 
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 #ifndef LIBTRACI
32 class NamedRTree;
33 class MSJunction;
34 class PositionVector;
35 #endif
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 namespace LIBSUMO_NAMESPACE {
45 class Junction {
46 public:
47  static libsumo::TraCIPosition getPosition(const std::string& junctionID, bool includeZ = false);
48  static libsumo::TraCIPositionVector getShape(const std::string& junctionID);
49 
52 
53 #ifndef LIBTRACI
54 #ifndef SWIG
59  static void storeShape(const std::string& id, PositionVector& shape);
60 
64  static NamedRTree* getTree();
65  static void cleanup();
66 
67  static std::shared_ptr<VariableWrapper> makeWrapper();
68 
69  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper, tcpip::Storage* paramData);
70 
71 private:
72  static MSJunction* getJunction(const std::string& id);
73 
74 private:
77  static NamedRTree* myTree;
78 #endif
79 #endif
80 private:
82  Junction() = delete;
83 };
84 }
#define LIBSUMO_ID_PARAMETER_API
Definition: TraCIDefs.h:108
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:56
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:75
static libsumo::TraCIPositionVector getShape(const std::string &junctionID)
static NamedRTree * myTree
Definition: Junction.h:77
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:76
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper, tcpip::Storage *paramData)
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:61
A list of positions.
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:279
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:278
A 3D-position.
Definition: TraCIDefs.h:164
A list of positions.
Definition: TraCIDefs.h:207