LIBINT 2.9.0
exception.h
1/*
2 * Copyright (C) 2004-2024 Edward F. Valeev
3 *
4 * This file is part of Libint compiler.
5 *
6 * Libint compiler 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 compiler 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 compiler. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#include <smart_ptr.h>
22
23#include <stdexcept>
24
25#ifndef _libint2_src_bin_libint_exception_h_
26#define _libint2_src_bin_libint_exception_h_
27
28namespace libint2 {
29
30class DGVertex;
31
32class InvalidDecrement : public std::logic_error {
33 public:
34 InvalidDecrement(const std::string& a) : logic_error(a){};
35};
36
37class CannotAddArc : public std::logic_error {
38 public:
39 CannotAddArc(const std::string& a) : logic_error(a){};
40};
41
42#if 0
45 class VertexAlreadyOnStack : public std::logic_error {
46
47 public:
48 VertexAlreadyOnStack(const std::shared_ptr<DGVertex>& vertex) :
49 logic_error("DirectedGraph -- vertex already on stack"), vertex_(vertex) {}
50 ~VertexAlreadyOnStack() noexcept {}
51
52 std::shared_ptr<DGVertex> vertex() const { return vertex_; }
53
54 private:
55 // Vertex on the stack
56 std::shared_ptr<DGVertex> vertex_;
57
58 };
59#endif
60
64class CannotPerformOperation : public std::logic_error {
65 public:
66 CannotPerformOperation(const std::string& msg) : logic_error(msg) {}
67 virtual ~CannotPerformOperation() noexcept {}
68};
69
71template <class T>
72class NotSet : public std::logic_error {
73 public:
74 NotSet(const std::string& a) : logic_error(a){};
75};
76
79class CodeDoesNotExist : public std::logic_error {
80 public:
81 CodeDoesNotExist(const std::string& a) : logic_error(a) {}
82};
83
85class ProgrammingError : public std::logic_error {
86 public:
87 ProgrammingError(const std::string& a) : logic_error(a) {}
88};
89
91class InputError : public std::logic_error {
92 public:
93 InputError(const std::string& a) : logic_error(a) {}
94};
95
96}; // namespace libint2
97
98#endif
Definition exception.h:37
This exception class is used to notify that a graph operation cannot be performed.
Definition exception.h:64
This exception used to indicate that some code hasn't been developed or generalized yet.
Definition exception.h:79
This exception used to indicate some error in the user-provided input.
Definition exception.h:91
Definition exception.h:32
This exception used to indicate that some property is not set.
Definition exception.h:72
This exception used to indicate some programming error.
Definition exception.h:85
This exception class is used to pass the pointer to the vertex on the graph.
Definition exception.h:45
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24