]> www.ginac.de Git - ginac.git/blob - ginac/fail.h
1ff994853049ce05e012e24919aaa864623a081d
[ginac.git] / ginac / fail.h
1 /** @file fail.h
2  *
3  *  Interface to class signaling failure of operation. Considered obsolete all
4  *  this stuff ought to be replaced by exceptions. */
5
6 #ifndef _FAIL_H_
7 #define _FAIL_H_
8
9 class fail;
10
11 #include "basic.h"
12 #include "flags.h"
13
14 class fail : public basic
15 {
16
17 // member functions
18
19     // default constructor, destructor, copy constructor assignment operator and helpers
20 public:
21     fail();
22     ~fail();
23     fail(fail const & other);
24     fail const & operator=(fail const & other);
25 protected:
26     void copy(fail const & other);
27     void destroy(bool call_parent);
28
29     // other constructors
30     // none
31
32     // functions overriding virtual functions from bases classes
33 public:
34     basic * duplicate() const;
35     void printraw(ostream & os) const;
36     void print(ostream & os, unsigned upper_precedence=0) const;
37 protected:
38     int compare_same_type(basic const & other) const;
39     unsigned return_type(void) const { return return_types::noncommutative_composite; };
40     
41     // new virtual functions which can be overridden by derived classes
42     // none
43
44     // non-virtual functions in this class
45     // none
46
47 // member variables
48 // none
49 };
50
51 // global constants
52
53 extern const fail some_fail;
54 extern type_info const & typeid_fail;
55
56 #endif // ndef _FAIL_H_
57
58