ug4
messaging.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2012: Steinbeis Forschungszentrum (STZ Ölbronn)
3  * Author: Michael Hoffer
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #include <string>
34 #include <deque>
35 #include <vector>
36 #include <jni.h>
37 
38 #include "common/ug_config.h"
39 
40 #ifndef MESSAGING_H
41 #define MESSAGING_H
42 
43 #define EMPHASIZE_BEGIN "\"<tt><b>"
44 #define EMPHASIZE_END "</tt></b>\""
45 
46 #define RED_BEGIN "<font color=\"red\">"
47 #define COLOR_END "</font>"
48 #define GREEN_BEGIN "<font color=\"green\">"
49 #define YELLOW_BEGIN "<font color=\"yellow\">"
50 
51 #define VRL_CRITICAL_ERROR ">> this is a critical error in UG-VRL bindings!" \
52  " Please write a bug report to " \
53  EMPHASIZE_BEGIN \
54  "Michael Hoffer &lt;michael.hoffer@gcsc.uni-frankfurt.de&gt;" \
55  EMPHASIZE_END \
56  ".\n"
57 
58 
59 namespace ug {
60 namespace vrl {
61 
72 std::string replaceAll(
73  std::string target,
74  const std::string oldstr,
75  const std::string newstr);
76 
84 std::vector<std::string> split(
85  const std::string& str,
86  const char delimiter);
87 
95 bool startsWith(std::string str, std::string search);
96 
104 bool contains(std::string str, std::string search);
105 
114 std::string getExceptionMessageString(JNIEnv* env, jthrowable ex);
115 
124 bool checkException(JNIEnv* env, std::string msg = "", bool throwCPPException = true);
125 
127 public:
132  static void addMessage(std::string msg);
139 private:
140 // static std::deque<std::string> messages;
141 // static std::string messageString;
142 // static unsigned int maxQueueSize;
143 
144 };
145 
146 } // end vrl::
147 }// end ug::
148 
149 
150 //namespace ug {
151 // namespace vrl {
152 //
153 // enum MessageType {
154 // /**
155 // * defines message as information
156 // */
157 // INFO,
158 // /**
159 // * defines message as information with singe pulse signal
160 // */
161 // INFO_SINGLE,
162 // /**
163 // * defines message as warning
164 // */
165 // WARNING,
166 // /**
167 // * defines message as warning with single pulse signal
168 // */
169 // WARNING_SINGLE,
170 // /**
171 // * defines message as error
172 // */
173 // ERROR,
174 // /**
175 // * defines message as error with single pulse signal
176 // */
177 // ERROR_SINGLE,
178 // /**
179 // * defines message as invisible
180 // */
181 // SILENT
182 // };
183 //
184 // void displayMessage(
185 // std::string title, std::string message, MessageType mType);
186 //
187 // } // vrl::
188 //} // ug::
189 //
190 
191 
192 
193 #endif /* MESSAGING_H */
194 
Definition: messaging.h:126
parameterString ex
Executes the specified script.
Definition: command_line_util.lua:350
#define UG_API
Definition: ug_config.h:65
size_t target(SM_edge< typename T::value_type > const &e, ug::BidirectionalMatrix< T > const &m)
Definition: bidirectional_boost.h:100
bool checkException(JNIEnv *env, std::string msg, bool throwCPPException)
Definition: messaging.cpp:117
std::string getExceptionMessageString(JNIEnv *env, jthrowable exception)
Definition: messaging.cpp:98
bool contains(std::string str, std::string search)
Definition: messaging.cpp:94
bool startsWith(std::string str, std::string search)
Definition: messaging.cpp:90
std::string replaceAll(std::string target, const std::string oldstr, const std::string newstr)
Definition: messaging.cpp:72
std::vector< std::string > split(const std::string &str, const char delimiter)
Definition: messaging.cpp:57
the ug namespace