Eclipse SUMO - Simulation of Urban MObility
MSVehicleDevice.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2007-2024 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 // Abstract in-vehicle device
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <string>
26 #include <vector>
27 #include <map>
28 #include <set>
29 #include <random>
32 #include "MSDevice.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
52 class MSVehicleDevice : public MSMoveReminder, public MSDevice {
53 public:
59  MSVehicleDevice(SUMOVehicle& holder, const std::string& id) :
60  MSMoveReminder(id), MSDevice(id), myHolder(holder) {
61  }
62 
63 
65  virtual ~MSVehicleDevice() { }
66 
67 
72  inline SUMOVehicle& getHolder() const {
73  return myHolder;
74  }
75 
77  return myHolder.getNumericalID();
78  }
79 
82  bool operator()(const MSVehicleDevice* const a, const MSVehicleDevice* const b) const {
84  }
85  };
86 
87 
88 protected:
91 
92 private:
95 
98 
99 };
Abstract in-vehicle / in-person device.
Definition: MSDevice.h:62
Something on a lane to be noticed about vehicle movement.
Abstract in-vehicle device.
MSVehicleDevice(SUMOVehicle &holder, const std::string &id)
Constructor.
SUMOVehicle & myHolder
The vehicle that stores the device.
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
MSVehicleDevice & operator=(const MSVehicleDevice &)
Invalidated assignment operator.
SUMOVehicle::NumericalID getNumericalID() const
MSVehicleDevice(const MSVehicleDevice &)
Invalidated copy constructor.
virtual ~MSVehicleDevice()
Destructor.
virtual NumericalID getNumericalID() const =0
return the numerical ID which is only for internal usage
long long int NumericalID
Representation of a vehicle.
Definition: SUMOVehicle.h:60
Function-object for stable sorting of objects with numerical ids.
bool operator()(const MSVehicleDevice *const a, const MSVehicleDevice *const b) const