LIBINT  2.6.0
exception.h
1 /*
2  * Copyright (C) 2004-2019 Edward F. Valeev
3  *
4  * This file is part of Libint.
5  *
6  * Libint is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Libint is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Libint. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #include <stdexcept>
22 #include <smart_ptr.h>
23 
24 #ifndef _libint2_src_bin_libint_exception_h_
25 #define _libint2_src_bin_libint_exception_h_
26 
27 
28 namespace libint2 {
29 
30  class DGVertex;
31 
32  class InvalidDecrement : public std::logic_error {
33 
34  public:
35  InvalidDecrement(const std::string& a) :
36  logic_error(a) {};
37 
38  };
39 
40  class CannotAddArc : public std::logic_error {
41 
42  public:
43  CannotAddArc(const std::string& a) :
44  logic_error(a) {};
45 
46  };
47 
48 #if 0
49 
51  class VertexAlreadyOnStack : public std::logic_error {
52 
53  public:
54  VertexAlreadyOnStack(const SafePtr<DGVertex>& vertex) :
55  logic_error("DirectedGraph -- vertex already on stack"), vertex_(vertex) {}
56  ~VertexAlreadyOnStack() throw() {}
57 
58  SafePtr<DGVertex> vertex() const { return vertex_; }
59 
60  private:
61  // Vertex on the stack
62  SafePtr<DGVertex> vertex_;
63 
64  };
65 #endif
66 
69  class CannotPerformOperation : public std::logic_error {
70  public:
71  CannotPerformOperation(const std::string& msg) :
72  logic_error(msg) {}
73  virtual ~CannotPerformOperation() throw() {}
74  };
75 
77  template <class T>
78  class NotSet : public std::logic_error {
79 
80  public:
81  NotSet(const std::string& a) :
82  logic_error(a) {};
83  };
84 
87  class CodeDoesNotExist : public std::logic_error {
88 
89  public:
90  CodeDoesNotExist(const std::string& a) :
91  logic_error(a) {}
92  };
93 
95  class ProgrammingError : public std::logic_error {
96 
97  public:
98  ProgrammingError(const std::string& a) :
99  logic_error(a) {}
100  };
101 
103  class InputError : public std::logic_error {
104 
105  public:
106  InputError(const std::string& a) :
107  logic_error(a) {}
108  };
109 
110 
111 };
112 
113 #endif
114 
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
This exception used to indicate that some property is not set.
Definition: exception.h:78
This exception used to indicate some error in the user-provided input.
Definition: exception.h:103
This exception class is used to notify that a graph operation cannot be performed.
Definition: exception.h:69
Definition: exception.h:32
Definition: exception.h:40
This exception used to indicate some programming error.
Definition: exception.h:95
This exception class is used to pass the pointer to the vertex on the graph.
Definition: exception.h:51
This exception used to indicate that some code hasn't been developed or generalized yet.
Definition: exception.h:87