DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
AnyIssue.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/AnyIssue.h to include/ers/AnyIssue.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 * AnyIssue.h
14 * ers
15 *
16 * Created by Serguei Kolos on 26.06.10.
17 * Copyright 2010 CERN. All rights reserved.
18 *
19 */
20
21#ifndef ERS_ANY_ISSUE_H
22#define ERS_ANY_ISSUE_H
23
27
28#include <ers/Issue.hpp>
29
30namespace ers {
31class AnyIssue : public ers::Issue
32{
33
34 friend class IssueFactory;
35
36public:
37 AnyIssue(const std::string& type, const ers::Context& context, const std::string& message = "")
39 , m_type(type)
40 {
41 ;
42 }
43
44 AnyIssue(const std::string& type,
45 const inheritance_type& chain,
47 const ers::Context& context,
48 const system_clock::time_point& time,
49 const std::string& message,
50 const std::vector<std::string>& qualifiers,
51 const std::map<std::string, std::string>& parameters,
52 const ers::Issue* cause = 0)
54 , m_type(type)
55 , m_inheritance(chain)
56 {
57 ;
58 }
59
60 ~AnyIssue() noexcept { ; }
61
62 virtual ers::Issue* clone() const { return new AnyIssue(*this); }
63
64 virtual const char* get_class_name() const { return m_type.c_str(); }
65
66 virtual inheritance_type get_class_inheritance() const final { return m_inheritance; }
67
68 virtual void raise() const { throw AnyIssue(*this); }
69
70private:
71 std::string m_type;
73};
74}
75
76#endif
std::string m_type
Definition AnyIssue.hpp:71
virtual inheritance_type get_class_inheritance() const final
Get inheritance chain.
Definition AnyIssue.hpp:66
~AnyIssue() noexcept
Definition AnyIssue.hpp:60
inheritance_type m_inheritance
Definition AnyIssue.hpp:72
friend class IssueFactory
Definition AnyIssue.hpp:34
AnyIssue(const std::string &type, const inheritance_type &chain, Severity severity, const ers::Context &context, const system_clock::time_point &time, const std::string &message, const std::vector< std::string > &qualifiers, const std::map< std::string, std::string > &parameters, const ers::Issue *cause=0)
Definition AnyIssue.hpp:44
virtual void raise() const
throws a copy of this issue preserving the real issue type
Definition AnyIssue.hpp:68
virtual ers::Issue * clone() const
Definition AnyIssue.hpp:62
AnyIssue(const std::string &type, const ers::Context &context, const std::string &message="")
Definition AnyIssue.hpp:37
virtual const char * get_class_name() const
Get key for class (used for serialisation).
Definition AnyIssue.hpp:64
An abstract interface to access an Issue context.
Definition Context.hpp:40
Base class for any user define issue.
Definition Issue.hpp:76
const Context & context() const
Context of the issue.
Definition Issue.hpp:102
ers::Severity severity() const
severity of the issue
Definition Issue.hpp:110
const std::vector< std::string > & qualifiers() const
return array of qualifiers
Definition Issue.hpp:106
const std::string & message() const
General cause of the issue.
Definition Issue.hpp:104
const string_map & parameters() const
return array of parameters
Definition Issue.hpp:108
std::string time(const std::string &format="%Y-%b-%d %H:%M:%S", bool isUTC=false) const
string representation of local time of the issue
Definition Issue.hpp:213
Issue(const Context &context, const std::string &message=std::string())
Definition Issue.cpp:80
const Issue * cause() const
return the cause Issue of this Issue
Definition Issue.hpp:100
std::list< std::string > inheritance_type
Definition Issue.hpp:54