cfl_exception.cpp
Go to the documentation of this file.
1/** @file cfl_exception.cpp Class Exception */
2
3/* FAU Discrete Event Systems Library (libfaudes)
4
5 Copyright (C) 2006 Bernd Opitz
6 Exclusive copyright is granted to Klaus Schmidt
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
21
22
23#include "cfl_exception.h"
24
25namespace faudes {
26
27Exception::Exception(const std::string& rFunctionName,
28 const std::string& rDescription, unsigned int errorId, bool mute)
29 : exception(), mFunctionName(rFunctionName),
30 mDescription(rDescription), mErrorId(errorId) {
31 mMessage="libFAUDES Exception: " + rFunctionName + ": " +rDescription;
32#ifdef FAUDES_DEBUG_EXCEPTIONS
33 if(!mute) {
34 FAUDES_WRITE_CONSOLE("FAUDES_EXCEPTION: " + rFunctionName + ": " +rDescription);
35 }
36#endif
37}
38
40
41const char* Exception::Where() const throw() {
42 return mFunctionName.c_str();
43}
44
45const char* Exception::What() const throw() {
46 return mDescription.c_str();
47}
48
49unsigned int Exception::Id() const throw() {
50 return mErrorId;
51}
52
53const char* Exception::Message() const throw() {
54 return mMessage.c_str();
55}
56
57} // namespace faudes
#define FAUDES_WRITE_CONSOLE(message)
virtual const char * What() const
std::string mDescription
unsigned int mErrorId
std::string mFunctionName
virtual unsigned int Id() const
virtual const char * Message() const
Exception(const std::string &rFunctionName, const std::string &rDescription, unsigned int errorId, bool mute=false)
virtual const char * Where() const
std::string mMessage

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen