DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1#ifndef OKS_EXCEPTIONS_H
2#define OKS_EXCEPTIONS_H
3
4#include <exception>
5#include <string>
6#include <iostream>
7
8namespace dunedaq {
9namespace oks {
10
13 class exception : public std::exception {
14
15 private:
16
17 std::string p_what;
19
20
21 public:
22
23 exception(const std::string& what_arg, int level_arg) noexcept;
24
25 virtual ~exception() noexcept { }
26
27
30 int level() const noexcept { return p_level; }
31
32
35 virtual const char * what() const noexcept { return p_what.c_str(); }
36
37 };
38
39 inline std::ostream & operator<<( std::ostream & s, const oks::exception & ex) { s << ex.what(); return s; }
40
41 void throw_validate_not_empty(const char * name);
42
43
46 inline void validate_not_empty(const std::string& value, const char * name) {
47 if(value.empty()) throw_validate_not_empty(name);
48 }
49} //namespace oks
50} //namespace dunedaq
51
52#endif
virtual ~exception() noexcept
virtual const char * what() const noexcept
int level() const noexcept
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:44
Including Qt Headers.
Definition __init__.py:1