ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
RuntimeErrorStream.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2010-2022 The ESPResSo project
3
*
4
* This file is part of ESPResSo.
5
*
6
* ESPResSo is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* ESPResSo is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef ESPRESSO_SRC_CORE_ERROR_HANDLING_RUNTIME_ERROR_STREAM_HPP
21
#define ESPRESSO_SRC_CORE_ERROR_HANDLING_RUNTIME_ERROR_STREAM_HPP
22
23
#include "
RuntimeError.hpp
"
24
25
#include <sstream>
26
#include <string>
27
28
namespace
ErrorHandling
{
29
30
class
RuntimeErrorCollector;
31
32
/** @brief Create a runtime error message via the streaming operator */
33
class
RuntimeErrorStream
{
34
public
:
35
RuntimeErrorStream
(
const
RuntimeErrorStream
&rhs);
36
RuntimeErrorStream
(
RuntimeErrorCollector
&ec,
RuntimeError::ErrorLevel
level,
37
std::string file,
int
line, std::string function);
38
~RuntimeErrorStream
();
39
template
<
typename
T>
RuntimeErrorStream
&
operator<<
(T
const
&value) {
40
m_buff << value;
41
return
*
this
;
42
}
43
44
private
:
45
RuntimeErrorCollector
&m_ec;
46
RuntimeError::ErrorLevel
m_level;
47
const
int
m_line;
48
const
std::string m_file, m_function;
49
std::ostringstream m_buff;
50
};
51
52
}
// namespace ErrorHandling
53
54
#endif
RuntimeError.hpp
ErrorHandling::RuntimeErrorCollector
Definition
RuntimeErrorCollector.hpp:33
ErrorHandling::RuntimeErrorStream
Create a runtime error message via the streaming operator.
Definition
RuntimeErrorStream.hpp:33
ErrorHandling::RuntimeErrorStream::operator<<
RuntimeErrorStream & operator<<(T const &value)
Definition
RuntimeErrorStream.hpp:39
ErrorHandling::RuntimeErrorStream::~RuntimeErrorStream
~RuntimeErrorStream()
Definition
RuntimeErrorStream.cpp:41
ErrorHandling
Definition
RuntimeError.cpp:26
ErrorHandling::RuntimeError::ErrorLevel
ErrorLevel
The error level, warnings are only displayed to the user, errors are fatal.
Definition
RuntimeError.hpp:40
src
core
error_handling
RuntimeErrorStream.hpp
Generated on Fri Nov 22 2024 02:13:54 for ESPResSo by
1.9.8