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