Eclipse SUMO - Simulation of Urban MObility
RouteProbe.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 /****************************************************************************/
18 // C++ TraCI client API implementation
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <vector>
24 #include <libsumo/TraCIDefs.h>
25 
26 
27 // ===========================================================================
28 // class declarations
29 // ===========================================================================
30 #ifndef LIBTRACI
31 class MSRouteProbe;
32 namespace libsumo {
33 class VariableWrapper;
34 }
35 #endif
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
44 namespace LIBSUMO_NAMESPACE {
45 class RouteProbe {
46 public:
47  static std::string getEdgeID(const std::string& probeID);
48  //static double getFrequency(const std::string& meanDataID);
49 
50  static std::string sampleLastRouteID(const std::string& probeID);
51  static std::string sampleCurrentRouteID(const std::string& probeID);
52  //static std::vector<std::pair<std::string, doube> > getLastRoutes(const std::string& probeID);
53  //static std::vector<std::pair<std::string, doube> > getCurrentRoutes(const std::string& probeID);
54 
57 #ifndef LIBTRACI
58  static std::shared_ptr<VariableWrapper> makeWrapper();
59 
60  static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper);
61 
62 private:
63  static MSRouteProbe* getRouteProbe(const std::string& id);
64 
65 private:
68 #endif
70  RouteProbe() = delete;
71 };
72 
73 
74 }
#define LIBSUMO_ID_PARAMETER_API
Definition: TraCIDefs.h:97
#define LIBSUMO_SUBSCRIPTION_API
Definition: TraCIDefs.h:44
static std::string getEdgeID(const std::string &probeID)
static bool handleVariable(const std::string &objID, const int variable, VariableWrapper *wrapper)
static MSRouteProbe * getRouteProbe(const std::string &id)
static std::string sampleLastRouteID(const std::string &probeID)
static std::string sampleCurrentRouteID(const std::string &probeID)
static SubscriptionResults mySubscriptionResults
Definition: RouteProbe.h:66
RouteProbe()=delete
invalidated standard constructor
static ContextSubscriptionResults myContextSubscriptionResults
Definition: RouteProbe.h:67
LIBSUMO_ID_PARAMETER_API static LIBSUMO_SUBSCRIPTION_API std::shared_ptr< VariableWrapper > makeWrapper()
Writes routes of vehicles passing a certain edge.
Definition: MSRouteProbe.h:58
std::map< std::string, TraCIResults > SubscriptionResults
{object->{variable->value}}
Definition: TraCIDefs.h:250
std::map< std::string, SubscriptionResults > ContextSubscriptionResults
Definition: TraCIDefs.h:251