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