3 * Implementation of class signaling failure of operation. Considered
4 * obsolete all this stuff ought to be replaced by exceptions. */
7 * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef NO_NAMESPACE_GINAC
30 #endif // ndef NO_NAMESPACE_GINAC
32 GINAC_IMPLEMENT_REGISTERED_CLASS(fail, basic)
35 // default constructor, destructor, copy constructor assignment operator and helpers
40 fail::fail() : inherited(TINFO_fail)
42 debugmsg("fail default constructor",LOGLEVEL_CONSTRUCT);
47 debugmsg("fail destructor",LOGLEVEL_DESTRUCT);
51 fail::fail(const fail & other)
53 debugmsg("fail copy constructor",LOGLEVEL_CONSTRUCT);
57 const fail & fail::operator=(const fail & other)
59 debugmsg("fail operator=",LOGLEVEL_ASSIGNMENT);
69 void fail::copy(const fail & other)
71 inherited::copy(other);
74 void fail::destroy(bool call_parent)
76 if (call_parent) inherited::destroy(call_parent);
90 /** Construct object from archive_node. */
91 fail::fail(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
93 debugmsg("fail constructor from archive_node", LOGLEVEL_CONSTRUCT);
96 /** Unarchive the object. */
97 ex fail::unarchive(const archive_node &n, const lst &sym_lst)
99 return (new fail(n, sym_lst))->setflag(status_flags::dynallocated);
102 /** Archive the object. */
103 void fail::archive(archive_node &n) const
105 inherited::archive(n);
109 // functions overriding virtual functions from bases classes
114 basic * fail::duplicate() const
116 debugmsg("fail duplicate",LOGLEVEL_DUPLICATE);
117 return new fail(*this);
120 void fail::print(std::ostream & os, unsigned upper_precedence) const
122 debugmsg("fail print",LOGLEVEL_PRINT);
126 void fail::printraw(std::ostream & os) const
128 debugmsg("fail printraw",LOGLEVEL_PRINT);
134 int fail::compare_same_type(const basic & other) const
136 // two fails are always identical
141 // new virtual functions which can be overridden by derived classes
147 // non-virtual functions in this class
153 // static member variables
162 const fail some_fail;
163 const std::type_info & typeid_fail = typeid(some_fail);
165 #ifndef NO_NAMESPACE_GINAC
167 #endif // ndef NO_NAMESPACE_GINAC