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.org/sumo
3 // Copyright (C) 2007-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 /****************************************************************************/
16 // Abstract in-vehicle device
17 /****************************************************************************/
18 #ifndef MSVehicleDevice_h
19 #define MSVehicleDevice_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <vector>
29 #include <map>
30 #include <set>
31 #include <random>
34 #include "MSDevice.h"
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
54 class MSVehicleDevice : public MSMoveReminder, public MSDevice {
55 public:
61  MSVehicleDevice(SUMOVehicle& holder, const std::string& id) :
62  MSMoveReminder(id), MSDevice(id), myHolder(holder) {
63  }
64 
65 
67  virtual ~MSVehicleDevice() { }
68 
69 
74  inline SUMOVehicle& getHolder() const {
75  return myHolder;
76  }
77 
79  return myHolder.getNumericalID();
80  }
81 
82 protected:
85 
86 private:
89 
92 
93 };
94 
95 
96 #endif
97 
98 /****************************************************************************/
99 
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
SUMOVehicle::NumericalID
long long int NumericalID
Definition: SUMOVehicle.h:62
MSVehicleDevice::myHolder
SUMOVehicle & myHolder
The vehicle that stores the device.
Definition: MSVehicleDevice.h:84
MSDevice.h
MSMoveReminder
Something on a lane to be noticed about vehicle movement.
Definition: MSMoveReminder.h:66
SUMOVehicle.h
MSMoveReminder.h
MSVehicleDevice::MSVehicleDevice
MSVehicleDevice(const MSVehicleDevice &)
Invalidated copy constructor.
SUMOVehicle::getNumericalID
virtual NumericalID getNumericalID() const =0
return the numerical ID which is only for internal usage
MSDevice
Abstract in-vehicle / in-person device.
Definition: MSDevice.h:63
MSVehicleDevice::~MSVehicleDevice
virtual ~MSVehicleDevice()
Destructor.
Definition: MSVehicleDevice.h:67
MSVehicleDevice::getHolder
SUMOVehicle & getHolder() const
Returns the vehicle that holds this device.
Definition: MSVehicleDevice.h:74
MSVehicleDevice::MSVehicleDevice
MSVehicleDevice(SUMOVehicle &holder, const std::string &id)
Constructor.
Definition: MSVehicleDevice.h:61
config.h
MSVehicleDevice::getNumericalID
SUMOVehicle::NumericalID getNumericalID() const
Definition: MSVehicleDevice.h:78
MSVehicleDevice::operator=
MSVehicleDevice & operator=(const MSVehicleDevice &)
Invalidated assignment operator.
MSVehicleDevice
Abstract in-vehicle device.
Definition: MSVehicleDevice.h:54