Line data Source code
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 :
24 : /** \file AnyIssue.h
25 : * This file defines the ers::AnyIssue class
26 : */
27 :
28 : #include <ers/Issue.hpp>
29 :
30 : namespace ers {
31 : class AnyIssue : public ers::Issue
32 : {
33 :
34 : friend class IssueFactory;
35 :
36 : public:
37 0 : AnyIssue(const std::string& type, const ers::Context& context, const std::string& message = "")
38 0 : : ers::Issue(context, message)
39 0 : , m_type(type)
40 : {
41 0 : ;
42 0 : }
43 :
44 0 : AnyIssue(const std::string& type,
45 : const inheritance_type& chain,
46 : Severity severity,
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)
53 0 : : ers::Issue(severity, time, context, message, qualifiers, parameters, cause)
54 0 : , m_type(type)
55 0 : , m_inheritance(chain)
56 : {
57 0 : ;
58 0 : }
59 :
60 0 : ~AnyIssue() noexcept { ; }
61 :
62 0 : virtual ers::Issue* clone() const { return new AnyIssue(*this); }
63 :
64 0 : virtual const char* get_class_name() const { return m_type.c_str(); }
65 :
66 0 : virtual inheritance_type get_class_inheritance() const final { return m_inheritance; }
67 :
68 0 : virtual void raise() const { throw AnyIssue(*this); }
69 :
70 : private:
71 : std::string m_type;
72 : inheritance_type m_inheritance;
73 : };
74 : }
75 :
76 : #endif
|