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.dev/sumo
3 // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
18 // Event send when a message (message, warning, error) has to besubmitted
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include "GUIEvent.h"
24 #include <string>
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
36 class GUIEvent_Message : public GUIEvent {
37 public:
39  GUIEvent_Message(const std::string& msg)
41  }
42 
43  GUIEvent_Message(GUIEventType type, const std::string& msg):
44  GUIEvent(type), myMsg(msg) {}
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 };
GUIEventType
Definition: GUIEvent.h:32
@ MESSAGE_OCCURRED
send when a message occured
@ GLDEBUG_OCCURRED
send when a gldebug occured
@ ERROR_OCCURRED
send when a error occured
@ STATUS_OCCURRED
send when a status change occured
@ DEBUG_OCCURRED
send when a debug occured
@ WARNING_OCCURRED
send when a warning occured
GUIEvent_Message(GUIEventType type, const std::string &msg)
GUIEvent_Message(MsgHandler::MsgType type, const std::string &msg)
constructor
std::string myMsg
The message.
GUIEvent_Message(const std::string &msg)
constructor
const std::string & getMsg() const
Returns the message.
~GUIEvent_Message()
destructor
GUIEventType myType
the type of the event
Definition: GUIEvent.h:102
@ MT_GLDEBUG
The message is GL debug output.
@ MT_DEBUG
The message is debug output.
@ MT_MESSAGE
The message is only something to show.
@ MT_ERROR
The message is an error.
@ MT_WARNING
The message is a warning.