DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
oks
include
oks
exceptions.hpp
Go to the documentation of this file.
1
// DUNE DAQ modification notice:
2
// This file has been modified from the original ATLAS oks source for the DUNE DAQ project.
3
// Fork baseline commit: oks-08-03-04 (2022-04-14).
4
// Renamed since fork: yes (from oks/exceptions.h to include/oks/exceptions.hpp).
5
6
#ifndef OKS_EXCEPTIONS_H
7
#define OKS_EXCEPTIONS_H
8
9
#include <exception>
10
#include <iostream>
11
#include <string>
12
13
namespace
dunedaq
{
14
namespace
oks
{
15
17
18
class
exception
:
public
std::exception
19
{
20
21
private
:
22
std::string
p_what
;
23
int
p_level
;
24
25
public
:
26
exception
(
const
std::string& what_arg,
int
level_arg)
noexcept
;
27
28
virtual
~exception
() noexcept {}
29
31
32
int
level
() const noexcept {
return
p_level
; }
33
35
36
virtual
const
char
*
what
() const noexcept {
return
p_what
.c_str(); }
37
};
38
39
inline
std::ostream&
40
operator<<
(std::ostream& s,
const
oks::exception
& ex)
41
{
42
s << ex.
what
();
43
return
s;
44
}
45
46
void
47
throw_validate_not_empty
(
const
char
* name);
48
50
51
inline
void
52
validate_not_empty
(
const
std::string& value,
const
char
* name)
53
{
54
if
(value.empty())
55
throw_validate_not_empty
(name);
56
}
57
}
// namespace oks
58
}
// namespace dunedaq
59
60
#endif
dunedaq::oks::exception
Definition
exceptions.hpp:19
dunedaq::oks::exception::~exception
virtual ~exception() noexcept
Definition
exceptions.hpp:28
dunedaq::oks::exception::p_level
int p_level
Definition
exceptions.hpp:23
dunedaq::oks::exception::what
virtual const char * what() const noexcept
Definition
exceptions.hpp:36
dunedaq::oks::exception::level
int level() const noexcept
Definition
exceptions.hpp:32
dunedaq::oks::exception::p_what
std::string p_what
Definition
exceptions.hpp:22
dunedaq::oks::exception::exception
exception(const std::string &what_arg, int level_arg) noexcept
Definition
xml.cpp:41
dunedaq::oks
Definition
SchemaCommand.hpp:17
dunedaq::oks::validate_not_empty
void validate_not_empty(const std::string &value, const char *name)
Definition
exceptions.hpp:52
dunedaq::oks::operator<<
std::ostream & operator<<(std::ostream &s, const oks::exception &ex)
Definition
exceptions.hpp:40
dunedaq::oks::throw_validate_not_empty
void throw_validate_not_empty(const char *name)
Definition
xml.cpp:50
dunedaq
The DUNE-DAQ namespace.
Definition
cib_utilities.cpp:5
Generated on
for DUNE-DAQ by
1.18.0