MSMessageEmitter.h
Go to the documentation of this file.00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MSMessageEmitter_h
00020 #define MSMessageEmitter_h
00021
00022
00023
00024
00025
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031
00032 #ifdef _MESSAGES
00033
00034 #include <string>
00035
00036
00037
00038
00039
00040 class OutputDevice;
00041 class MSLane;
00042
00043
00044
00045
00046
00054 class MSMessageEmitter {
00055 public:
00056 MSMessageEmitter(std::string& file, const std::string& base, std::string& whatemit,
00057 bool reverse = false, bool tableOut = true, bool xy = false, SUMOReal step = 1);
00058
00059 virtual ~MSMessageEmitter();
00060
00061 void writeLaneChangeEvent(const std::string& id, SUMOReal& timeStep, MSLane *oldlane, SUMOReal myPos,
00062 SUMOReal mySpeed, MSLane *newlane, SUMOReal x, SUMOReal y);
00063
00064 void writeBreakEvent(const std::string& id, SUMOReal& timeStep, MSLane *lane, SUMOReal myPos,
00065 SUMOReal speed, SUMOReal x, SUMOReal y);
00066
00067 void writeHeartBeatEvent(const std::string &id, SUMOReal& timeStep, MSLane* lane, SUMOReal myPos,
00068 SUMOReal speed, SUMOReal x, SUMOReal y);
00069
00070 bool getWriteLCEvent();
00071
00072 bool getWriteBEvent();
00073
00074 bool getWriteHBEvent();
00075
00076 bool getEventsEnabled(const std::string& enabled);
00077
00078 private:
00079
00080 std::string trimmed(const std::string& str, const char* sepSet = " \t\n\r");
00081
00082 void setWriteEvents(std::string &events);
00083
00084 void setFile(const std::string& file);
00085
00086 void initXML();
00087
00088 OutputDevice &myDev;
00089
00090 bool writeLCEvent;
00091 bool writeBEvent;
00092 bool writeHBEvent;
00093 bool reverseOrder;
00094 bool tableOutput;
00095 bool xyCoords;
00096 SUMOReal myStep;
00097 };
00098 #endif //_MESSAGES
00099
00100 #endif