OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
SDDSParserException.h
Go to the documentation of this file.
1 //
2 // Class SDDSParserException
3 //
4 // Copyright (c) 2018, Christof Metzger-Kraus, Open Sourcerer
5 // All rights reserved
6 //
7 // This file is part of OPAL.
8 //
9 // OPAL is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
16 //
17 #ifndef __SDDSPARSEREXCEPTION_H__
18 #define __SDDSPARSEREXCEPTION_H__
19 
20 #include <string>
21 
23 
24 public:
25 
26  SDDSParserException(const std::string &meth, const std::string &descr) {
27  descr_ = descr;
28  meth_ = meth;
29  }
30 
31  virtual const char* what() const throw() {
32  return descr_.c_str();
33  }
34 
35  virtual const char* where() const throw() {
36  return meth_.c_str();
37  }
38 
39 private:
40 
41  std::string descr_;
42  std::string meth_;
43 
44 };
45 
46 #endif
SDDSParserException(const std::string &meth, const std::string &descr)
virtual const char * what() const
virtual const char * where() const