SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSDevice_Example.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A device which stands as an implementation example and which outputs movereminder calls
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef MSDevice_Example_h
21 #define MSDevice_Example_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "MSDevice.h"
34 #include <utils/common/SUMOTime.h>
35 
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class SUMOVehicle;
41 
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
54 class MSDevice_Example : public MSDevice {
55 public:
59  static void insertOptions(OptionsCont& oc);
60 
61 
72  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
73 
74 
75 public:
78 
79 
82 
92  bool notifyMove(SUMOVehicle& veh, SUMOReal oldPos,
93  SUMOReal newPos, SUMOReal newSpeed);
94 
95 
105 
106 
115  bool notifyLeave(SUMOVehicle& veh, SUMOReal lastPos,
118 
119 
126  void generateOutput() const;
127 
128 
129 private:
135  MSDevice_Example(SUMOVehicle& holder, const std::string& id, SUMOReal customValue1,
136  SUMOReal customValue2, SUMOReal customValue3);
137 
138 
139 private:
140  // private state members of the Example device
141 
148 
149 
150 private:
153 
156 
157 
158 };
159 
160 
161 #endif
162 
163 /****************************************************************************/
164 
~MSDevice_Example()
Destructor.
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Saves departure info on insertion.
SUMOReal myCustomValue3
a value which is initialised based on a vType parameter
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
Notification
Definition of a vehicle state.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks for waiting steps when the vehicle moves.
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Saves arrival info.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_Example-options.
SUMOReal myCustomValue2
a value which is initialised based on a vehicle parameter
MSDevice_Example & operator=(const MSDevice_Example &)
Invalidated assignment operator.
Representation of a vehicle.
Definition: SUMOVehicle.h:63
Abstract in-vehicle device.
Definition: MSDevice.h:68
void generateOutput() const
Called on writing tripinfo output.
MSDevice_Example(SUMOVehicle &holder, const std::string &id, SUMOReal customValue1, SUMOReal customValue2, SUMOReal customValue3)
Constructor.
A storage for options typed value containers)
Definition: OptionsCont.h:108
#define SUMOReal
Definition: config.h:221
SUMOReal myCustomValue1
a value which is initialised based on a commandline/configuration option