ATLAS Offline Software
Control/AthToolSupport/AsgMessaging/AsgMessaging/StatusCode.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ASGMESSAGING_STATUSCODE_H
6 #define ASGMESSAGING_STATUSCODE_H
7 
8 // Local include(s):
9 #include "AsgMessaging/Check.h"
10 
11 #ifndef XAOD_STANDALONE
12 // Pull in the definition from Gaudi:
13 # include "GaudiKernel/StatusCode.h"
14 #else // not XAOD_STANDALONE
15 
16 #include "CxxUtils/nodiscard.h"
30 
31 public:
33  enum {
34  FAILURE = 0,
35  SUCCESS = 1,
36  RECOVERABLE = 2
37  };
38 
40  StatusCode( unsigned long rstat = SUCCESS ) noexcept : m_code( rstat ) { }
41 
43  StatusCode& operator= ( unsigned long code ) noexcept { m_code = code; return *this; }
44 
46  bool isSuccess() const noexcept { return m_code == SUCCESS; }
48  bool isFailure() const noexcept { return !isSuccess(); }
50  bool isRecoverable() const noexcept { return m_code == RECOVERABLE; }
51 
53  operator unsigned long() const noexcept { return m_code; }
54 
56  void ignore() const noexcept { }
57 
62  void setChecked() const noexcept { }
63  static void enableFailure() noexcept { }
64  static void enableChecking() noexcept { }
65  static void disableFailure() noexcept { }
66  static void disableChecking() noexcept { }
67 
68 private:
70  unsigned long m_code;
71 
72 }; // class StatusCode
73 
74 #endif // not XAOD_STANDALONE
75 #endif // ASGMESSAGING_STATUSCODE_H
Check.h
columnar::operator=
AccessorTemplate & operator=(AccessorTemplate &&that)
Definition: VectorColumn.h:88
nodiscard.h
Macro wrapping the [[nodiscard]] attribute.
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
ATLAS_NODISCARD
#define ATLAS_NODISCARD
Definition: nodiscard.h:18
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
histSizes.code
code
Definition: histSizes.py:129
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CondContStatusCode::SUCCESS
@ SUCCESS
CondContStatusCode::RECOVERABLE
@ RECOVERABLE
CondContStatusCode::FAILURE
@ FAILURE