libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
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 <QString>
35
#include <QDebug>
36
#include <QException>
37
38
namespace
pappso
39
{
40
class
PappsoException
:
public
QException
41
{
42
public
:
43
explicit
PappsoException
(
const
QString &message)
throw
()
44
:
m_message
(QString(
"%1@%2: %3"
).arg(__FILE__, __FUNCTION__, message)),
45
m_stdMessage
(
m_message
.toStdString())
46
{
47
}
48
49
PappsoException
(
const
PappsoException
&other)
throw
()
50
:
m_message
(other.m_message),
m_stdMessage
(other.m_stdMessage)
51
{
52
}
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
const
char
*
72
what
() const noexcept
override
73
{
74
return
m_stdMessage
.c_str();
75
}
76
77
virtual
~PappsoException
() throw()
78
{
79
}
80
81
private
:
82
QString
m_message
;
// Description of the error
83
std::string
m_stdMessage
;
84
};
85
}
// namespace pappso
pappso::PappsoException::PappsoException
PappsoException(const PappsoException &other)
Definition
pappsoexception.h:49
pappso::PappsoException::PappsoException
PappsoException(const QString &message)
Definition
pappsoexception.h:43
pappso::PappsoException::clone
virtual QException * clone() const override
Definition
pappsoexception.h:60
pappso::PappsoException::m_message
QString m_message
Definition
pappsoexception.h:82
pappso::PappsoException::what
const char * what() const noexcept override
Definition
pappsoexception.h:72
pappso::PappsoException::qwhat
virtual const QString & qwhat() const
Definition
pappsoexception.h:66
pappso::PappsoException::raise
void raise() const override
Definition
pappsoexception.h:55
pappso::PappsoException::m_stdMessage
std::string m_stdMessage
Definition
pappsoexception.h:83
pappso::PappsoException::~PappsoException
virtual ~PappsoException()
Definition
pappsoexception.h:77
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappsomspp
core
pappsoexception.h
Generated on
for libpappsomspp by
1.17.0