LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ExitCodePrinter.h
Go to the documentation of this file.
1 #ifndef art_Framework_Art_detail_ExitCodePrinter_h
2 #define art_Framework_Art_detail_ExitCodePrinter_h
3 
5 #include <iostream>
6 
7 namespace art::detail {
9  public:
11  operator=(int exitcode) noexcept
12  {
13  code_ = exitcode;
14  return *this;
15  }
16 
17  ~ExitCodePrinter() noexcept
18  {
19  if (code_ != info_success()) {
20  std::cout << "Art has completed and will exit with status " << code_
21  << "." << std::endl;
22  }
23  }
24 
25  int
26  exitcode() const noexcept
27  {
28  return code_ == info_success() ? 0 : code_;
29  }
30 
31  private:
32  int code_{};
33  };
34 }
35 
36 #endif /* art_Framework_Art_detail_ExitCodePrinter_h */
37 
38 // Local Variables:
39 // mode: c++
40 // End:
int exitcode() const noexcept
constexpr int info_success()
Definition: info_success.h:8
ExitCodePrinter & operator=(int exitcode) noexcept