DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
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 <string>
11#include <iostream>
12
13namespace dunedaq {
14namespace oks {
15
17
18 class exception : public std::exception {
19
20 private:
21
22 std::string p_what;
24
25
26 public:
27
28 exception(const std::string& what_arg, int level_arg) noexcept;
29
30 virtual ~exception() noexcept { }
31
32
34
35 int level() const noexcept { return p_level; }
36
37
39
40 virtual const char * what() const noexcept { return p_what.c_str(); }
41
42 };
43
44 inline std::ostream & operator<<( std::ostream & s, const oks::exception & ex) { s << ex.what(); return s; }
45
46 void throw_validate_not_empty(const char * name);
47
48
50
51 inline void validate_not_empty(const std::string& value, const char * name) {
52 if(value.empty()) throw_validate_not_empty(name);
53 }
54} //namespace oks
55} //namespace dunedaq
56
57#endif
virtual ~exception() noexcept
virtual const char * what() const noexcept
int level() const noexcept
exception(const std::string &what_arg, int level_arg) noexcept
Definition xml.cpp:42
caught dunedaq::conffwk::Exception exception
void validate_not_empty(const std::string &value, const char *name)
std::ostream & operator<<(std::ostream &s, const oks::exception &ex)
void throw_validate_not_empty(const char *name)
Definition xml.cpp:49
Including Qt Headers.
Definition module.cpp:16