SUMO - Simulation of Urban MObility
GNEVariableSpeedSignStep.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 #ifndef GNEVariableSpeedSignStep_h
20 #define GNEVariableSpeedSignStep_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <vector>
35 
36 #include "GNEAttributeCarrier.h"
37 
38 // ===========================================================================
39 // class declarations
40 // ===========================================================================
41 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
53 
54 public:
56  GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog);
57 
59  GNEVariableSpeedSignStep(GNEVariableSpeedSign* variableSpeedSignParent, double time, double speed);
60 
63 
66 
68  void writeStep(OutputDevice& device);
69 
71  double getTime() const;
72 
75  /* @brief method for getting the Attribute of an XML key
76  * @param[in] key The attribute key
77  * @return string with the value associated to key
78  */
79  std::string getAttribute(SumoXMLAttr key) const;
80 
81  /* @brief method for setting the attribute and letting the object perform additional changes
82  * @param[in] key The attribute key
83  * @param[in] value The new value
84  * @param[in] undoList The undoList on which to register changes
85  * @param[in] net optionally the GNENet to inform about gui updates
86  */
87  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
88 
89  /* @brief method for setting the attribute and letting the object perform additional changes
90  * @param[in] key The attribute key
91  * @param[in] value The new value
92  * @param[in] undoList The undoList on which to register changes
93  */
94  bool isValid(SumoXMLAttr key, const std::string& value);
96 
97 protected:
100 
102  double myTime;
103 
105  double mySpeed;
106 
109 
110 private:
112  void setAttribute(SumoXMLAttr key, const std::string& value);
113 
116 
119 };
120 
121 #endif
122 
123 /****************************************************************************/
GNEVariableSpeedSign * myVariableSpeedSignParent
pointer to variable speed sign parent
void writeStep(OutputDevice &device)
write step into XML
SumoXMLTag
Numbers representing SUMO-XML - element names.
GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog *variableSpeedSignDialog)
default constructor
double getTime() const
get time
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SumoXMLTag myTag
XML Tag of a variable speed sign interval.
std::string getAttribute(SumoXMLAttr key) const
inherited from GNEAttributeCarrier
GNEVariableSpeedSignStep & operator=(const GNEVariableSpeedSignStep &)=delete
Invalidated assignment operator.
double mySpeed
speed in this timeStep
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool isValid(SumoXMLAttr key, const std::string &value)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
GNEVariableSpeedSign * getVariableSpeedSignParent() const
get variable speed sign parent