* This file was generated automatically by structure.pl.
* Please do not modify it directly, edit the perl script instead!
*
- * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "structure.h"
-#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
class ${STRUCTURE} : public structure
{
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
+ // default ctor, dtor, copy ctor, assignment operator and helpers
public:
${STRUCTURE}();
~${STRUCTURE}();
void copy(${STRUCTURE} const & other);
void destroy(bool call_parent);
- // other constructors
+ // other ctors
public:
${STRUCTURE}(${constructor_arglist});
- // functions overriding virtual functions from bases classes
+ // functions overriding virtual functions from base classes
public:
basic * duplicate() const;
- void printraw(ostream & os) const;
- void print(ostream & os, unsigned upper_precedence=0) const;
- void printtree(ostream & os, unsigned indent) const;
+ void print(const print_context & c, unsigned level = 0) const;
int nops() const;
ex & let_op(int i);
ex expand(unsigned options=0) const;
extern const type_info & typeid_${STRUCTURE};
extern const unsigned tinfo_${STRUCTURE};
-// macros
-
-#define ex_to_${STRUCTURE}(X) (static_cast<${STRUCTURE} const &>(*(X).bp))
-
-#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC
#endif // ndef _${STRUCTURE_UC}_H_
* This file was generated automatically by STRUCTURE.pl.
* Please do not modify it directly, edit the perl script instead!
*
- * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
${input_structure}
#include <iostream>
+#include <stdexcept>
#include "${STRUCTURE}.h"
+#include "print.h"
-#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
//////////
-// default constructor, destructor, copy constructor assignment operator and helpers
+// default ctor, destructor, copy ctor assignment operator and helpers
//////////
// public
${STRUCTURE}::${STRUCTURE}()
{
- debugmsg("${STRUCTURE} default constructor",LOGLEVEL_CONSTRUCT);
tinfo_key=tinfo_${STRUCTURE};
}
${STRUCTURE}::~${STRUCTURE}()
{
- debugmsg("${STRUCTURE} destructor",LOGLEVEL_DESTRUCT);
- destroy(0);
+ destroy(false);
}
${STRUCTURE}::${STRUCTURE}(${STRUCTURE} const & other)
{
- debugmsg("${STRUCTURE} copy constructor",LOGLEVEL_CONSTRUCT);
copy(other);
}
${STRUCTURE} const & ${STRUCTURE}::operator=(${STRUCTURE} const & other)
{
- debugmsg("${STRUCTURE} operator=",LOGLEVEL_ASSIGNMENT);
if (this != &other) {
- destroy(1);
+ destroy(true);
copy(other);
}
return *this;
}
//////////
-// other constructors
+// other ctors
//////////
// public
${STRUCTURE}::${STRUCTURE}(${constructor_arglist})
: ${constructor_statements}
{
- debugmsg("${STRUCTURE} constructor from children", LOGLEVEL_CONSTRUCT);
tinfo_key=tinfo_${STRUCTURE};
}
//////////
-// functions overriding virtual functions from bases classes
+// functions overriding virtual functions from base classes
//////////
// public
basic * ${STRUCTURE}::duplicate() const
{
- debugmsg("${STRUCTURE} duplicate",LOGLEVEL_DUPLICATE);
return new ${STRUCTURE}(*this);
}
-void ${STRUCTURE}::printraw(ostream & os) const
-{
- debugmsg("${STRUCTURE} printraw",LOGLEVEL_PRINT);
- os << "${STRUCTURE}()";
-}
-
-void ${STRUCTURE}::print(ostream & os, unsigned upper_precedence) const
-{
- debugmsg("${STRUCTURE} print",LOGLEVEL_PRINT);
- os << "${STRUCTURE}()";
-}
-
-void ${STRUCTURE}::printtree(ostream & os, unsigned indent) const
+void ${STRUCTURE}::print(const print_context & c, unsigned level) const
{
- debugmsg("${STRUCTURE} printtree",LOGLEVEL_PRINT);
- os << "${STRUCTURE}()";
+ c.s << class_name() << "()";
}
int ${STRUCTURE}::nops() const
switch (i) {
${let_op_statements}
}
- errormsg("${STRUCTURE}::let_op(): should not reach this point");
- return *new ex(fail());
+ throw(std::runtime_error("${STRUCTURE}::let_op(): should not have reached this point"));
}
ex ${STRUCTURE}::expand(unsigned options) const
int ${STRUCTURE}::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
- ${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
- (const_cast<basic &>(other));
+ ${STRUCTURE} const &o = static_cast<const ${STRUCTURE} &>(other);
int cmpval;
${compare_statements}
return 0;
bool ${STRUCTURE}::is_equal_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
- ${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
- (const_cast<basic &>(other));
+ ${STRUCTURE} const &o = static_cast<const ${STRUCTURE} &>(other);
${is_equal_statements}
return true;
}
const type_info & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}");
-#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC
END_OF_IMPLEMENTATION