File: Exceptions.hh

package info (click to toggle)
cadabra2 2.4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 78,732 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (81 lines) | stat: -rw-r--r-- 2,096 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

#pragma once

#include <stdexcept>
#include <string>

class CadabraException : public std::logic_error {
	public:
		CadabraException(std::string);
	};

// Exception thrown when an inconsist expression or argument is encountered.

class ConsistencyException : public CadabraException {
	public:
		ConsistencyException(std::string);
	};

// Exception thrown when the parser cannot parse an input expression.

class ParseException : public CadabraException {
	public:
		ParseException(std::string);
	};

// Exception thrown when an algorithm determines that it was interrupted.

class InterruptionException : public CadabraException {
	public:
		InterruptionException(std::string="");
	};

/// Exception thrown when arguments to an algorithm or property are not correct.

class ArgumentException : public CadabraException {
	public:
		ArgumentException(std::string="");

		std::string py_what() const;
	};

/// Exception thrown when something requires that an expression is a pure scalar
/// (i.e. no free indices and no dummy indices), but isn't.

class NonScalarException : public CadabraException {
	public:
		NonScalarException(std::string="");

		std::string py_what() const;
	};

/// Exception thrown when an algorithm cannot complete, e.g. because it does not
/// yet know how to process a particular expression. This gets thrown if returning
/// the original expression would be a mathematical error.

class RuntimeException : public CadabraException {
	public:
		RuntimeException(std::string="");
	};


/// Exception thrown when there the Cadabra code detects an internal inconsistency;
/// this should never happen, but is better than bailing out with an assert.

class InternalError : public CadabraException {
	public:
		InternalError(std::string="");

		std::string py_what() const;
	};

/// Exception thrown when there the Cadabra code detects an internal inconsistency;
/// this should never happen, but is better than bailing out with an assert.

class NotYetImplemented : public CadabraException {
	public:
		NotYetImplemented(std::string="");

		std::string py_what() const;
	};