Eclipse SUMO - Simulation of Urban MObility
MsgHandlerSynchronized.cpp
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 /****************************************************************************/
16 // Retrieves messages about the process and gives them further to output
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #ifdef HAVE_FOX
26 #include <fx.h>
27 #endif
28 #include "MsgHandlerSynchronized.h"
29 
30 
31 // ===========================================================================
32 // static member variables
33 // ===========================================================================
34 #ifdef HAVE_FOX
35 FXMutex MsgHandlerSynchronized::myLock(true);
36 #endif
37 
38 
39 // ===========================================================================
40 // method definitions
41 // ===========================================================================
42 void
43 MsgHandlerSynchronized::inform(std::string msg, bool addType) {
44 #ifdef HAVE_FOX
45  FXMutexLock locker(myLock);
46 #endif
47  MsgHandler::inform(msg, addType);
48 }
49 
50 
51 void
52 MsgHandlerSynchronized::beginProcessMsg(std::string msg, bool addType) {
53 #ifdef HAVE_FOX
54  FXMutexLock locker(myLock);
55 #endif
56  MsgHandler::beginProcessMsg(msg, addType);
57 }
58 
59 
60 void
62 #ifdef HAVE_FOX
63  FXMutexLock locker(myLock);
64 #endif
66 }
67 
68 
69 void
71 #ifdef HAVE_FOX
72  FXMutexLock locker(myLock);
73 #endif
75 }
76 
77 
78 void
80 #ifdef HAVE_FOX
81  FXMutexLock locker(myLock);
82 #endif
83  MsgHandler::addRetriever(retriever);
84 }
85 
86 
87 void
89 #ifdef HAVE_FOX
90  FXMutexLock locker(myLock);
91 #endif
92  MsgHandler::removeRetriever(retriever);
93 }
94 
95 
97  MsgHandler(type) {
98 }
99 
100 
102 }
103 
104 
105 /****************************************************************************/
void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
virtual void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
Definition: MsgHandler.cpp:166
void clear()
Clears information whether an error occurred previously.
void addRetriever(OutputDevice *retriever)
Adds a further retriever to the instance responsible for a certain msg type.
virtual void removeRetriever(OutputDevice *retriever)
Removes the retriever from the handler.
Definition: MsgHandler.cpp:174
virtual void beginProcessMsg(std::string msg, bool addType=true)
Begins a process information.
Definition: MsgHandler.cpp:135
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
Definition: MsgHandler.cpp:118
void beginProcessMsg(std::string msg, bool addType=true)
Begins a process information.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
MsgHandlerSynchronized(MsgType type)
standard constructor
void endProcessMsg(std::string msg)
Ends a process information.
virtual void clear()
Clears information whether an error occurred previously.
Definition: MsgHandler.cpp:160
static FXMutex myLock
The lock for synchronizing all outputs using handlers of this class.
virtual void endProcessMsg(std::string msg)
Ends a process information.
Definition: MsgHandler.cpp:148
void inform(std::string msg, bool addType=true)
adds a new error to the list