Eclipse SUMO - Simulation of Urban MObility
GUIEvent_Message.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-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 /****************************************************************************/
15 // Event send when a message (message, warning, error) has to besubmitted
16 /****************************************************************************/
17 #ifndef GUIEvent_Message_h
18 #define GUIEvent_Message_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "GUIEvent.h"
27 #include <string>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 class GUIEvent_Message : public GUIEvent {
40 public:
42  GUIEvent_Message(const std::string& msg)
44  }
45 
47  GUIEvent_Message(MsgHandler::MsgType type, const std::string& msg)
49  switch (type) {
52  break;
55  break;
58  break;
61  break;
64  break;
65  default:
66  throw 1;
67  }
68  }
69 
72 
74  const std::string& getMsg() const {
75  return myMsg;
76  }
77 
78 protected:
79 
81  std::string myMsg;
82 
83 };
84 
85 
86 #endif
87 
88 /****************************************************************************/
89 
MsgHandler::MsgType
MsgType
Definition: MsgHandler.h:51
MsgHandler::MT_ERROR
The message is an error.
Definition: MsgHandler.h:57
EVENT_MESSAGE_OCCURRED
send when a message occured
Definition: GUIEvent.h:43
MsgHandler::MT_MESSAGE
The message is only something to show.
Definition: MsgHandler.h:53
MsgHandler.h
MsgHandler::MT_WARNING
The message is a warning.
Definition: MsgHandler.h:55
GUIEvent_Message::getMsg
const std::string & getMsg() const
Returns the message.
Definition: GUIEvent_Message.h:74
EVENT_STATUS_OCCURRED
send when a status change occured
Definition: GUIEvent.h:58
EVENT_DEBUG_OCCURRED
send when a debug occured
Definition: GUIEvent.h:52
EVENT_WARNING_OCCURRED
send when a warning occured
Definition: GUIEvent.h:46
EVENT_GLDEBUG_OCCURRED
send when a gldebug occured
Definition: GUIEvent.h:55
EVENT_ERROR_OCCURRED
send when a error occured
Definition: GUIEvent.h:49
GUIEvent_Message::~GUIEvent_Message
~GUIEvent_Message()
destructor
Definition: GUIEvent_Message.h:71
GUIEvent
Definition: GUIEvent.h:77
MsgHandler::MT_DEBUG
The message is an debug.
Definition: MsgHandler.h:59
GUIEvent.h
GUIEvent_Message::myMsg
std::string myMsg
The message.
Definition: GUIEvent_Message.h:81
config.h
GUIEvent::myType
GUIEventType myType
the type of the event
Definition: GUIEvent.h:93
MsgHandler::MT_GLDEBUG
The message is an debug.
Definition: MsgHandler.h:61
GUIEvent_Message::GUIEvent_Message
GUIEvent_Message(MsgHandler::MsgType type, const std::string &msg)
constructor
Definition: GUIEvent_Message.h:47
GUIEvent_Message
Definition: GUIEvent_Message.h:39
GUIEvent_Message::GUIEvent_Message
GUIEvent_Message(const std::string &msg)
constructor
Definition: GUIEvent_Message.h:42