RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
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#include <exception>
17#include <string>
18
19class RDKIT_DATASTRUCTS_EXPORT DatastructsException : public std::exception {
20 public:
21 //! construct with an error message
22 DatastructsException(const char *msg) : _msg(msg) {}
23 //! construct with an error message
24 DatastructsException(std::string msg) : _msg(std::move(msg)) {}
25 //! get the error message
26 const char *what() const noexcept override { return _msg.c_str(); }
27 ~DatastructsException() noexcept override = default;
28
29 private:
30 std::string _msg;
31};
32
33#endif
DatastructsException(const char *msg)
construct with an error message
~DatastructsException() noexcept override=default
DatastructsException(std::string msg)
construct with an error message
const char * what() const noexcept override
get the error message
#define RDKIT_DATASTRUCTS_EXPORT
Definition export.h:111