Eclipse SUMO - Simulation of Urban MObility
MSDevice_FCD.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2013-2019 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 /****************************************************************************/
15 // A device which records floating car data
16 /****************************************************************************/
17 #ifndef MSDevice_FCD_h
18 #define MSDevice_FCD_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "MSVehicleDevice.h"
27 #include <utils/common/SUMOTime.h>
28 
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class SUMOVehicle;
34 class SUMOTrafficObject;
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
48 class MSDevice_FCD : public MSVehicleDevice {
49 public:
53  static void insertOptions(OptionsCont& oc);
54 
55 
66  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSVehicleDevice*>& into);
67 
68 public:
70  ~MSDevice_FCD();
71 
72  bool notifyEnter(SUMOTrafficObject& /*veh*/, MSMoveReminder::Notification /*reason*/, const MSLane* /*enteredLane*/) {
73  return false;
74  }
75 
76  void saveState(OutputDevice& /* out */) const {
77  }
78 
80  const std::string deviceName() const {
81  return "fcd";
82  }
83 
84  static const std::set<const MSEdge*>& getEdgeFilter() {
85  return myEdgeFilter;
86  }
87 
89  static void cleanup();
90 
91 private:
97  MSDevice_FCD(SUMOVehicle& holder, const std::string& id);
98 
99 
101  static std::set<const MSEdge*> myEdgeFilter;
103 
105  static void initEdgeFilter();
106 
107 private:
110 
113 
114 
115 };
116 
117 
118 #endif
119 
120 /****************************************************************************/
121 
MSDevice_FCD::insertOptions
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCD-options.
Definition: MSDevice_FCD.cpp:47
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:47
MSDevice_FCD::operator=
MSDevice_FCD & operator=(const MSDevice_FCD &)
Invalidated assignment operator.
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSVehicleDevice.h
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSDevice_FCD::getEdgeFilter
static const std::set< const MSEdge * > & getEdgeFilter()
Definition: MSDevice_FCD.h:84
MSDevice_FCD::buildVehicleDevices
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
Definition: MSDevice_FCD.cpp:57
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSDevice_FCD
A device which collects info on the vehicle trip (mainly on departure and arrival)
Definition: MSDevice_FCD.h:48
MSDevice_FCD::myEdgeFilterInitialized
static bool myEdgeFilterInitialized
Definition: MSDevice_FCD.h:102
MSDevice_FCD::saveState
void saveState(OutputDevice &) const
Saves the state of the device.
Definition: MSDevice_FCD.h:76
MSDevice_FCD::cleanup
static void cleanup()
resets the edge filter
Definition: MSDevice_FCD.cpp:104
MSDevice_FCD::MSDevice_FCD
MSDevice_FCD(const MSDevice_FCD &)
Invalidated copy constructor.
MSDevice_FCD::deviceName
const std::string deviceName() const
return the name for this type of device
Definition: MSDevice_FCD.h:80
MSDevice_FCD::myEdgeFilter
static std::set< const MSEdge * > myEdgeFilter
spatial filter for FCD output
Definition: MSDevice_FCD.h:101
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSDevice_FCD::~MSDevice_FCD
~MSDevice_FCD()
Destructor.
Definition: MSDevice_FCD.cpp:77
config.h
MSDevice_FCD::initEdgeFilter
static void initEdgeFilter()
initialize edge filter (once)
Definition: MSDevice_FCD.cpp:82
MSDevice_FCD::notifyEnter
bool notifyEnter(SUMOTrafficObject &, MSMoveReminder::Notification, const MSLane *)
Checks whether the reminder is activated by a vehicle entering the lane.
Definition: MSDevice_FCD.h:72
MSMoveReminder::Notification
Notification
Definition of a vehicle state.
Definition: MSMoveReminder.h:91
MSDevice_FCD::MSDevice_FCD
MSDevice_FCD(SUMOVehicle &holder, const std::string &id)
Constructor.
Definition: MSDevice_FCD.cpp:72
MSVehicleDevice
Abstract in-vehicle device.
Definition: MSVehicleDevice.h:54