DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Severity.hpp
Go to the documentation of this file.
1/*
2 * DUNE DAQ modification notice:
3 * This file has been modified from the original ATLAS ers source for the DUNE DAQ project.
4 * Fork baseline commit: 8267df82a4f6fe6bf02c4014923eba19eddc4614 (2020-04-14).
5 * Renamed since fork: yes (from ers/Severity.h to include/ers/Severity.hpp).
6 *
7 * Original copyright:
8 * Copyright (C) 2001-2020 CERN for the benefit of the ATLAS collaboration.
9 * Licensed under the Apache License, Version 2.0.
10 */
11
12/*
13 * Severity.h
14 * ers
15 *
16 * Created by Serguei Kolos on 26.08.05.
17 * Copyright 2005 CERN. All rights reserved.
18 *
19 */
20
25
26#ifndef ERS_SEVERITY_H
27#define ERS_SEVERITY_H
28
29#include <string>
30#include <vector>
31#include <iostream>
32
33namespace ers
34{
35 class BadSeverity;
36
38
39 struct Severity
40 {
42 : type( severity ),
43 rank( level )
44 { ; }
45
46 operator ers::severity()
47 { return type; }
48
50 int rank;
51 };
52
53 severity parse( const std::string & s, severity & );
54 Severity parse( const std::string & s, Severity & );
55 std::string to_string( severity s );
56 std::string to_string( Severity s );
57
58 inline std::ostream & operator<<( std::ostream & out, ers::severity severity )
59 {
60 out << to_string( severity );
61 return out;
62 }
63
64 inline std::ostream & operator<<( std::ostream & out, const ers::Severity & severity )
65 {
66 out << to_string( severity );
67 return out;
68 }
69
70 inline std::istream & operator>>( std::istream & in, ers::severity & severity )
71 {
72 std::string string;
73 in >> string;
74 parse( string, severity );
75 return in;
76 }
77
78 inline std::istream & operator>>( std::istream & in, ers::Severity & severity )
79 {
80 std::string string;
81 in >> string;
82 parse( string, severity );
83 return in;
84 }
85}
86
87#endif
std::istream & operator>>(std::istream &in, ers::severity &severity)
Definition Severity.hpp:70
std::string to_string(severity s)
severity parse(const std::string &s, severity &)
Definition Severity.cpp:71
std::ostream & operator<<(std::ostream &, const ers::Configuration &)
severity
Definition Severity.hpp:37
@ Debug
Definition Severity.hpp:37
@ Error
Definition Severity.hpp:37
@ Fatal
Definition Severity.hpp:37
@ Log
Definition Severity.hpp:37
@ Warning
Definition Severity.hpp:37
@ Information
Definition Severity.hpp:37
operator ers::severity()
Definition Severity.hpp:46
Severity(ers::severity severity, int level=0)
Definition Severity.hpp:41
enum severity type
Definition Severity.hpp:49