PolyBoRi
PBoRiError.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 //*****************************************************************************
14 //*****************************************************************************
15 
16 #ifndef polybori_error_PBoRiError_h_
17 #define polybori_error_PBoRiError_h_
18 
19 // load PolyBoRi settings
20 #include <polybori/pbori_defs.h>
21 #include <exception>
22 
24 
31 class PBoRiError:
32  public std::exception, public CTypes {
33 
34 public:
36  typedef CTypes::errornum_type errornum_type;
37 
40 
42  typedef PBoRiError self;
43 
45  PBoRiError(errornum_type err = CTypes::alright);
46 
48  PBoRiError(const self&);
49 
51  ~PBoRiError() throw();
52 
54  errornum_type code() const;
55 
57  errortext_type text() const;
58 
60  const char* what() const throw() { return text(); }
61 
62 protected:
63  errornum_type error;
64 };
65 
67 
68 #endif // of #ifndef PBoRiError_h_
const char * errortext_type
Type used to verbose error information.
Definition: pbori_defs.h:243
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
This class is used for polybori's exception handling.
Definition: PBoRiError.h:31
CTypes::errornum_type errornum_type
adopt global error code enumeration
Definition: PBoRiError.h:36
errornum_type error
Definition: PBoRiError.h:63
This struct contains type definitions to be used in library classes.
Definition: pbori_defs.h:269
CTypes::errortext_type errortext_type
adopt global error text type
Definition: PBoRiError.h:39