HDTree  0.5.2
HDTree C++ API
Exception.h
1 #pragma once
2 
3 #include <string>
4 #include <exception>
5 #include <ostream>
6 
7 namespace hdtree {
8 
15 class HDTreeException : public std::exception {
17  std::string message_;
19  std::string help_;
20  public:
29  HDTreeException(const std::string& msg, const std::string& help = "") noexcept;
30 
36  const char* what() const noexcept;
37 
52  std::ostream& stream(std::ostream& o) const noexcept;
53 };
54 
55 }
56 
67 std::ostream& operator<<(std::ostream& o, const hdtree::HDTreeException& e);
user-facing exception class for hdtree
Definition: Exception.h:15
const char * what() const noexcept
Override the message from the base class.
Definition: Exception.cxx:8
HDTreeException(const std::string &msg, const std::string &help="") noexcept
Create a new exception.
Definition: Exception.cxx:5
std::string message_
the short message explaining the error
Definition: Exception.h:17
std::ostream & stream(std::ostream &o) const noexcept
Stream the message of this exception into the input output stream.
Definition: Exception.cxx:12
std::string help_
an optional, longer message providing help for the situation
Definition: Exception.h:19
Geant4 does a GLOBAL definition of the keyword TRUE.
Definition: Atomic.cxx:3