RDKit
Open-source cheminformatics and machine learning.
DatastructsException.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005-2006 Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 
11 #include <utility>
12 
13 #include <RDGeneral/export.h>
14 #ifndef _DATASTRUCTS_EXCEPTION_H_20050126
15 #define _DATASTRUCTS_EXCEPTION_H_20050126
16 
17 class RDKIT_DATASTRUCTS_EXPORT DatastructsException : public std::exception {
18  public:
19  //! construct with an error message
20  DatastructsException(const char *msg) : _msg(msg) {}
21  //! construct with an error message
22  DatastructsException(std::string msg) : _msg(std::move(msg)) {}
23  //! get the error message
24  const char *what() const noexcept override { return _msg.c_str(); }
25  ~DatastructsException() noexcept override = default;
26 
27  private:
28  std::string _msg;
29 };
30 
31 #endif
const char * what() const noexcept override
get the error message
DatastructsException(const char *msg)
construct with an error message
~DatastructsException() noexcept override=default
DatastructsException(std::string msg)
construct with an error message
#define RDKIT_DATASTRUCTS_EXPORT
Definition: export.h:81