Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/libsumo/Route.h
169666 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2012-2025 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
/****************************************************************************/
14
/// @file Route.h
15
/// @author Daniel Krajzewicz
16
/// @author Mario Krumnow
17
/// @author Michael Behrisch
18
/// @date 30.05.2012
19
///
20
// C++ TraCI client API implementation
21
/****************************************************************************/
22
#pragma once
23
#include <vector>
24
#include <libsumo/TraCIDefs.h>
25
26
27
// ===========================================================================
28
// class declarations
29
// ===========================================================================
30
#ifndef LIBTRACI
31
class MSRoute;
32
typedef std::shared_ptr<const MSRoute> ConstMSRoutePtr;
33
#endif
34
35
36
// ===========================================================================
37
// class definitions
38
// ===========================================================================
39
/**
40
* @class Route
41
* @brief C++ TraCI client API implementation
42
*/
43
namespace LIBSUMO_NAMESPACE {
44
class Route {
45
public:
46
47
static std::vector<std::string> getEdges(const std::string& routeID);
48
49
LIBSUMO_ID_PARAMETER_API
50
LIBSUMO_SUBSCRIPTION_API
51
52
static void add(const std::string& routeID, const std::vector<std::string>& edges);
53
static void remove(const std::string& routeID);
54
55
#ifndef LIBTRACI
56
#ifndef SWIG
57
static std::shared_ptr<VariableWrapper> makeWrapper();
58
59
static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper, tcpip::Storage* paramData);
60
61
private:
62
static ConstMSRoutePtr getRoute(const std::string& id);
63
64
private:
65
static SubscriptionResults mySubscriptionResults;
66
static ContextSubscriptionResults myContextSubscriptionResults;
67
#endif
68
#endif
69
70
/// @brief invalidated standard constructor
71
Route() = delete;
72
};
73
74
75
}
76
77