Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Incident.h
Go to the documentation of this file.
1 #ifndef GAUDI_INCIDENT_H
2 #define GAUDI_INCIDENT_H
3 
4 // Include files
6 #include "GaudiKernel/Kernel.h"
7 #include <string>
8 
18 
19 public:
21  Incident( const std::string& source,
22  const std::string& type
23  );
24 
25  Incident( const std::string& source,
26  const std::string& type,
27  const EventContext& ctx
28  )
29  : m_source( source ), m_type( type ), m_ctx( ctx ) {}
30 
32  virtual ~Incident() = default;
33 
38  const std::string& type() const { return m_type; }
39 
44  const std::string& source() const { return m_source; }
45 
50  EventContext context() const { return m_ctx; }
51 
52 private:
56 };
57 
58 #ifndef _inc_types_impl_
59 # define _inc_type_( x ) extern const std::string x
60 #else
61 # define _inc_type_( x ) \
62  extern const std::string x; \
63  const std::string x { #x }
64 #endif
65 
74 namespace IncidentType {
75  _inc_type_( BeginEvent );
76  _inc_type_( EndEvent );
77  _inc_type_( BeginRun );
78  _inc_type_( EndRun );
79  _inc_type_( EndStream );
80 
81  _inc_type_( AbortEvent );
82 
83 // Added by R. Lambert 2009-09-03, for summary services
84 // define a preprocessor macro to allow backward-compatibility
85 #define GAUDI_FILE_INCIDENTS
86 
87  _inc_type_( BeginOutputFile );
88  _inc_type_( FailOutputFile );
89  _inc_type_( WroteToOutputFile );
90  _inc_type_( EndOutputFile );
91 
92  _inc_type_( BeginInputFile );
93  _inc_type_( FailInputFile );
94  _inc_type_( EndInputFile );
95 
96  _inc_type_( CorruptedInputFile );
97 
99  _inc_type_( BeginProcessing );
101  _inc_type_( EndProcessing );
102 
106  _inc_type_( SvcPostFinalize );
107 } // namespace IncidentType
108 #undef _inc_type_
109 
110 #endif // GAUDI_INCIDENT_H
const std::string & type() const
Access to the incident type.
Definition: Incident.h:38
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:44
This class represents an entry point to all the event specific data.
Definition: EventContext.h:31
std::string m_type
incident type
Definition: Incident.h:54
STL class.
Incident(const std::string &source, const std::string &type, const EventContext &ctx)
Definition: Incident.h:25
#define _inc_type_(x)
Definition: Incident.h:59
Namespace for pre-defined common incident types.
std::string m_source
Incident source.
Definition: Incident.h:53
Base class for all Incidents (computing events).
Definition: Incident.h:17
EventContext context() const
Access to the EventContext of the source of the incident.
Definition: Incident.h:50
#define GAUDI_API
Definition: Kernel.h:71
EventContext m_ctx
Event Context when Incident created.
Definition: Incident.h:55