pappsomspp
Library for mass spectrometry
pappsoexception.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/pappsoexception.cpp
3
* \date 10/3/2015
4
* \author Olivier Langella
5
* \brief exception handler
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2015 Olivier Langella <Olivier.Langella@moulon.inra.fr>.
10
*
11
* This file is part of the PAPPSOms++ library.
12
*
13
* PAPPSOms++ is free software: you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation, either version 3 of the License, or
16
* (at your option) any later version.
17
*
18
* PAPPSOms++ is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
22
*
23
* You should have received a copy of the GNU General Public License
24
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25
*
26
* Contributors:
27
* Olivier Langella <Olivier.Langella@moulon.inra.fr> - initial API and
28
*implementation
29
******************************************************************************/
30
31
32
#pragma once
33
34
#include <exception>
35
#include <QString>
36
#include <QDebug>
37
#include <QException>
38
39
namespace
pappso
40
{
41
class
PappsoException :
public
QException
42
{
43
public
:
44
PappsoException
(
const
QString &message)
throw
()
45
{
46
qDebug() << message;
47
m_message
= message;
48
}
49
50
PappsoException
(
const
PappsoException
&other)
throw
()
51
{
52
m_message
= other.m_message;
53
}
54
void
55
raise
()
const
override
56
{
57
throw
*
this
;
58
}
59
virtual
QException *
60
clone
()
const override
61
{
62
return
new
PappsoException
(*
this
);
63
}
64
65
virtual
const
QString &
66
qwhat
()
const
throw()
67
{
68
return
m_message
;
69
}
70
71
virtual
const
char
*
72
what
()
const
throw()
override
73
{
74
return
m_message
.toStdString().c_str();
75
}
76
77
virtual
~PappsoException
() throw()
78
{
79
}
80
81
private
:
82
QString
m_message
;
// Description of the error
83
};
84
}
// namespace pappso
pappso
Definition:
aa.cpp:38
pappso::PappsoException::~PappsoException
virtual ~PappsoException()
Definition:
pappsoexception.h:116
pappso::PappsoException::m_message
QString m_message
Definition:
pappsoexception.h:121
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition:
pappsoexception.h:105
pappso::PappsoException::clone
virtual QException * clone() const override
Definition:
pappsoexception.h:99
pappso::PappsoException::what
virtual const char * what() const override
Definition:
pappsoexception.h:111
pappso::PappsoException::PappsoException
PappsoException(const QString &message)
Definition:
pappsoexception.h:83
pappsomspp
pappsoexception.h
Generated on Tue Apr 28 2020 14:35:52 for pappsomspp by
1.8.16