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
31{
32 class AnyIssue : public ers::Issue
33 {
34
35 friend class IssueFactory;
36
37 public:
38 AnyIssue( const std::string & type,
39 const ers::Context & context,
40 const std::string & message = "" )
41 : ers::Issue( context, message ),
42 m_type( type )
43 { ; }
44
45 AnyIssue( const std::string & type,
46 const inheritance_type & chain,
48 const ers::Context & context,
49 const system_clock::time_point & time,
50 const std::string & message,
51 const std::vector<std::string> & qualifiers,
52 const std::map<std::string, std::string> & parameters,
53 const ers::Issue * cause = 0 )
55 m_type( type ),
56 m_inheritance( chain )
57 { ; }
58
59 ~AnyIssue() noexcept { ; }
60
61 virtual ers::Issue * clone() const
62 { return new AnyIssue( *this ); }
63
64 virtual const char * get_class_name() const
65 { return m_type.c_str(); }
66
68 return m_inheritance ;
69 }
70
71 virtual void raise() const
72 { throw AnyIssue(*this); }
73
74 private:
75 std::string m_type;
77 };
78}
79
80#endif
81
std::string m_type
Definition AnyIssue.hpp:75
virtual inheritance_type get_class_inheritance() const final
Get inheritance chain.
Definition AnyIssue.hpp:67
~AnyIssue() noexcept
Definition AnyIssue.hpp:59
inheritance_type m_inheritance
Definition AnyIssue.hpp:76
friend class IssueFactory
Definition AnyIssue.hpp:35
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:45
virtual void raise() const
throws a copy of this issue preserving the real issue type
Definition AnyIssue.hpp:71
virtual ers::Issue * clone() const
Definition AnyIssue.hpp:61
AnyIssue(const std::string &type, const ers::Context &context, const std::string &message="")
Definition AnyIssue.hpp:38
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:41
Base class for any user define issue.
Definition Issue.hpp:80
const Context & context() const
Context of the issue.
Definition Issue.hpp:111
ers::Severity severity() const
severity of the issue
Definition Issue.hpp:123
const std::vector< std::string > & qualifiers() const
return array of qualifiers
Definition Issue.hpp:117
const std::string & message() const
General cause of the issue.
Definition Issue.hpp:114
const string_map & parameters() const
return array of parameters
Definition Issue.hpp:120
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:229
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:108
std::list< std::string > inheritance_type
Definition Issue.hpp:55