tinfo_key = TINFO_add;
}
-add::~add()
-{
- debugmsg("add destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-add::add(const add & other)
-{
- debugmsg("add copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const add & add::operator=(const add & other)
-{
- debugmsg("add operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void add::copy(const add & other)
friend class ncmul;
friend class power;
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- add();
- ~add();
- add(const add & other);
- const add & operator=(const add & other);
-protected:
- void copy(const add & other);
- void destroy(bool call_parent);
-
// other constructors
public:
add(const ex & lh, const ex & rh);
namespace GiNaC {
#endif // ndef NO_NAMESPACE_GINAC
-GINAC_IMPLEMENT_REGISTERED_CLASS(basic, void)
+GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(basic, void)
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
* It is responsible for the reference counting. */
class basic
{
- GINAC_DECLARE_REGISTERED_CLASS(basic, void)
+ GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(basic, void)
friend class ex;
tinfo_key = TINFO_clifford;
}
-clifford::~clifford()
-{
- debugmsg("clifford destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-clifford::clifford(const clifford & other)
-{
- debugmsg("clifford copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const clifford & clifford::operator=(const clifford & other)
-{
- debugmsg("clifford operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void clifford::copy(const clifford & other)
friend clifford clifford_gamma(const ex & mu);
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- clifford();
- ~clifford();
- clifford(const clifford & other);
- const clifford & operator=(const clifford & other);
-protected:
- void copy(const clifford & other);
- void destroy(bool call_parent);
-
// other constructors
public:
clifford(const std::string & n, const ex & mu);
debugmsg("color default constructor",LOGLEVEL_CONSTRUCT);
}
-color::~color()
-{
- debugmsg("color destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-color::color(const color & other)
-{
- debugmsg("color copy constructor",LOGLEVEL_CONSTRUCT);
- copy (other);
-}
-
-const color & color::operator=(const color & other)
-{
- debugmsg("color operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void color::copy(const color & other)
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- color();
- ~color();
- color(const color & other);
- const color & operator=(const color & other);
-protected:
- void copy(const color & other);
- void destroy(bool call_parent);
-
// other constructors
protected:
color(color_types const t, unsigned rl=0);
tinfo_key=TINFO_coloridx;
}
-coloridx::~coloridx()
-{
- debugmsg("coloridx destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-coloridx::coloridx(const coloridx & other)
-{
- debugmsg("coloridx copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const coloridx & coloridx::operator=(const coloridx & other)
-{
- debugmsg("coloridx operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void coloridx::copy(const coloridx & other)
friend class color;
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- coloridx();
- ~coloridx();
- coloridx (const coloridx & other);
- const coloridx & operator=(const coloridx & other);
-protected:
- void copy(const coloridx & other);
- void destroy(bool call_parent);
-
// other constructors
public:
explicit coloridx(bool cov);
debugmsg("constant default constructor",LOGLEVEL_CONSTRUCT);
}
-constant::~constant()
-{
- debugmsg("constant destructor",LOGLEVEL_DESTRUCT);
- destroy(0);
-}
-
-constant::constant(const constant & other)
-{
- debugmsg("constant copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
// protected
void constant::copy(const constant & other)
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- constant();
- ~constant();
- constant(const constant & other);
- // const constant & operator=(const constant & other); /* it's pervert! */
-protected:
- void copy(const constant & other);
- void destroy(bool call_parent);
-
// other constructors
public:
constant(const std::string & initname, evalffunctype efun=0);
{
GINAC_DECLARE_REGISTERED_CLASS(${CONTAINER}, basic)
-public:
- ${CONTAINER}();
- ~${CONTAINER}();
- ${CONTAINER}(${CONTAINER} const & other);
- ${CONTAINER} const & operator=(${CONTAINER} const & other);
-protected:
- void copy(${CONTAINER} const & other);
- void destroy(bool call_parent);
-
public:
${CONTAINER}(${STLT} const & s, bool discardable=0);
${CONTAINER}(${STLT} * vp); // vp will be deleted
debugmsg("${CONTAINER} default constructor",LOGLEVEL_CONSTRUCT);
}
-${CONTAINER}::~${CONTAINER}()
-{
- debugmsg("${CONTAINER} destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-${CONTAINER}::${CONTAINER}(${CONTAINER} const & other)
-{
- debugmsg("${CONTAINER} copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-${CONTAINER} const & ${CONTAINER}::operator=(${CONTAINER} const & other)
-{
- debugmsg("${CONTAINER} operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void ${CONTAINER}::copy(${CONTAINER} const & other)
#error "FIXME: expair_needs_further_processing not yet implemented for hashtabs, sorry. A.F."
#endif // def EXPAIRSEQ_USE_HASHTAB
-GINAC_IMPLEMENT_REGISTERED_CLASS(expairseq, basic)
+GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(expairseq, basic)
//////////
// helper classes
* the same way.) */
class expairseq : public basic
{
- GINAC_DECLARE_REGISTERED_CLASS(expairseq, basic)
+ GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(expairseq, basic)
// member functions
debugmsg("fail default constructor",LOGLEVEL_CONSTRUCT);
}
-fail::~fail()
-{
- debugmsg("fail destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-fail::fail(const fail & other)
-{
- debugmsg("fail copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const fail & fail::operator=(const fail & other)
-{
- debugmsg("fail operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void fail::copy(const fail & other)
{
GINAC_DECLARE_REGISTERED_CLASS(fail, basic)
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- fail();
- ~fail();
- fail(const fail & other);
- const fail & operator=(const fail & other);
-protected:
- void copy(const fail & other);
- void destroy(bool call_parent);
-
// other constructors
// none
// non-virtual functions in this class
// none
-// member variables
-// none
+ // member variables
+ // none
};
#ifndef NO_NAMESPACE_GINAC
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- function();
- ~function();
- function(const function & other);
- const function & operator=(const function & other);
-protected:
- void copy(const function & other);
- void destroy(bool call_parent);
-
// other constructors
public:
function(unsigned ser);
tinfo_key = TINFO_function;
}
-function::~function()
-{
- debugmsg("function destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-function::function(const function & other)
-{
- debugmsg("function copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const function & function::operator=(const function & other)
-{
- debugmsg("function operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void function::copy(const function & other)
name=autoname_prefix()+ToString(serial);
}
-idx::~idx()
-{
- debugmsg("idx destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-idx::idx(const idx & other)
-{
- debugmsg("idx copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const idx & idx::operator=(const idx & other)
-{
- debugmsg("idx operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void idx::copy(const idx & other)
{
GINAC_DECLARE_REGISTERED_CLASS(idx, basic)
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- idx();
- ~idx();
- idx (const idx & other);
- const idx & operator=(const idx & other);
-protected:
- void copy(const idx & other);
- void destroy(bool call_parent);
-
// other constructors
public:
explicit idx(bool cov);
tinfo_key=TINFO_indexed;
}
-indexed::~indexed()
-{
- debugmsg("indexed destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-indexed::indexed(const indexed & other)
-{
- debugmsg("indexed copy constructor",LOGLEVEL_CONSTRUCT);
- copy (other);
-}
-
-const indexed & indexed::operator=(const indexed & other)
-{
- debugmsg("indexed operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void indexed::copy(const indexed & other)
{
GINAC_DECLARE_REGISTERED_CLASS(indexed, exprseq)
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- indexed();
- ~indexed();
- indexed(const indexed & other);
- const indexed & operator=(const indexed & other);
-protected:
- void copy(const indexed & other);
- void destroy(bool call_parent);
-
// other constructors
public:
indexed(const ex & i1);
tinfo_key=TINFO_isospin;
}
-isospin::~isospin()
-{
- debugmsg("isospin destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-isospin::isospin(const isospin & other)
-{
- debugmsg("isospin copy constructor",LOGLEVEL_CONSTRUCT);
- copy (other);
-}
-
-const isospin & isospin::operator=(const isospin & other)
-{
- debugmsg("isospin operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void isospin::copy(const isospin & other)
{
GINAC_DECLARE_REGISTERED_CLASS(isospin, indexed)
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- isospin();
- ~isospin();
- isospin(const isospin & other);
- const isospin & operator=(const isospin & other);
-protected:
- void copy(const isospin & other);
- void destroy(bool call_parent);
-
// other constructors
public:
explicit isospin(const std::string & initname);
tinfo_key = TINFO_lorentzidx;
}
-lorentzidx::~lorentzidx()
-{
- debugmsg("lorentzidx destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-lorentzidx::lorentzidx(const lorentzidx & other)
-{
- debugmsg("lorentzidx copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const lorentzidx & lorentzidx::operator=(const lorentzidx & other)
-{
- debugmsg("lorentzidx operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void lorentzidx::copy(const lorentzidx & other)
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- lorentzidx();
- ~lorentzidx();
- lorentzidx (const lorentzidx & other);
- const lorentzidx & operator=(const lorentzidx & other);
-protected:
- void copy(const lorentzidx & other);
- void destroy(bool call_parent);
-
// other constructors
public:
explicit lorentzidx(bool cov, bool oonly=false, unsigned dimp=0);
name=autoname_prefix()+ToString(serial);
}
-lortensor::~lortensor()
-{
- debugmsg("lortensor destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-lortensor::lortensor(const lortensor & other)
-{
- debugmsg("lortensor copy constructor",LOGLEVEL_CONSTRUCT);
- copy (other);
-}
-
-const lortensor & lortensor::operator=(const lortensor & other)
-{
- debugmsg("lortensor operator=",LOGLEVEL_ASSIGNMENT);
- if (this != & other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
//protected
void lortensor::copy(const lortensor & other)
return _ex0();
}
} else if (idx1.is_symbolic() && idx1.is_co_contra_pair(idx2)) {
- return Dim() - 2;
+ return Dim();
}
}
return this -> hold();
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- lortensor();
- ~lortensor();
- lortensor(const lortensor & other);
- const lortensor & operator=(const lortensor & other);
-protected:
- void copy(const lortensor & other);
- void destroy(bool call_parent);
-
// other constructors
protected:
lortensor(lortensor_types const lt, const std::string & n);
m.push_back(_ex0());
}
-matrix::~matrix()
-{
- debugmsg("matrix destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-matrix::matrix(const matrix & other)
-{
- debugmsg("matrix copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const matrix & matrix::operator=(const matrix & other)
-{
- debugmsg("matrix operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void matrix::copy(const matrix & other)
{
GINAC_DECLARE_REGISTERED_CLASS(matrix, basic)
-// friends
-// (none)
-// member functions
-
- // default constructor, destructor, copy constructor, assignment operator
- // and helpers:
-public:
- matrix();
- ~matrix();
- matrix(const matrix & other);
- const matrix & operator=(const matrix & other);
-protected:
- void copy(const matrix & other);
- void destroy(bool call_parent);
-
// other constructors
public:
matrix(unsigned r, unsigned c);
tinfo_key = TINFO_mul;
}
-mul::~mul()
-{
- debugmsg("mul destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-mul::mul(const mul & other)
-{
- debugmsg("mul copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const mul & mul::operator=(const mul & other)
-{
- debugmsg("mul operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void mul::copy(const mul & other)
friend class ncmul;
friend class power;
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- mul();
- ~mul();
- mul(const mul & other);
- const mul & operator=(const mul & other);
-protected:
- void copy(const mul & other);
- void destroy(bool call_parent);
-
// other constructors
public:
mul(const ex & lh, const ex & rh);
tinfo_key = TINFO_ncmul;
}
-ncmul::~ncmul()
-{
- debugmsg("ncmul destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-ncmul::ncmul(const ncmul & other)
-{
- debugmsg("ncmul copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const ncmul & ncmul::operator=(const ncmul & other)
-{
- debugmsg("ncmul operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void ncmul::copy(const ncmul & other)
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- ncmul();
- ~ncmul();
- ncmul(const ncmul & other);
- const ncmul & operator=(const ncmul & other);
-protected:
- void copy(const ncmul & other);
- void destroy(bool call_parent);
-
// other constructors
public:
ncmul(const ex & lh, const ex & rh);
status_flags::hash_calculated);
}
-numeric::~numeric()
-{
- debugmsg("numeric destructor" ,LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-numeric::numeric(const numeric & other)
-{
- debugmsg("numeric copy constructor", LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const numeric & numeric::operator=(const numeric & other)
-{
- debugmsg("numeric operator=", LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void numeric::copy(const numeric & other)
{
GINAC_DECLARE_REGISTERED_CLASS(numeric, basic)
-// friends
-// (none)
-
// member functions
- // default constructor, destructor, copy constructor assignment
- // operator and helpers
-public:
- numeric();
- ~numeric();
- numeric(const numeric & other);
- const numeric & operator=(const numeric & other);
-protected:
- void copy(const numeric & other);
- void destroy(bool call_parent);
-
// other constructors
public:
explicit numeric(int i);
debugmsg("power default constructor",LOGLEVEL_CONSTRUCT);
}
-power::~power()
-{
- debugmsg("power destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-power::power(const power & other)
-{
- debugmsg("power copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const power & power::operator=(const power & other)
-{
- debugmsg("power operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void power::copy(const power & other)
// member functions
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- power();
- ~power();
- power(const power & other);
- const power & operator=(const power & other);
-protected:
- void copy(const power & other);
- void destroy(bool call_parent);
-
// other constructors
public:
power(const ex & lh, const ex & rh);
debugmsg("pseries default constructor", LOGLEVEL_CONSTRUCT);
}
-pseries::~pseries()
-{
- debugmsg("pseries destructor", LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-pseries::pseries(const pseries &other)
-{
- debugmsg("pseries copy constructor", LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const pseries &pseries::operator=(const pseries & other)
-{
- debugmsg("pseries operator=", LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
void pseries::copy(const pseries &other)
{
inherited::copy(other);
{
GINAC_DECLARE_REGISTERED_CLASS(pseries, basic)
- // default constructor, destructor, copy constructor, assignment operator and helpers
-public:
- pseries();
- ~pseries();
- pseries(const pseries &other);
- const pseries &operator=(const pseries &other);
-protected:
- void copy(const pseries &other);
- void destroy(bool call_parent);
-
// other constructors
public:
pseries(const ex &rel_, const epvector &ops_);
};
-/** Macro for inclusion in the declaration of each registered class. */
-#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername) \
+#define GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(classname, supername) \
public: \
typedef supername inherited; \
static registered_class_info reg_info; \
virtual const char *class_name(void) const; \
classname(const archive_node &n, const lst &sym_lst); \
virtual void archive(archive_node &n) const; \
- static ex unarchive(const archive_node &n, const lst &sym_lst); \
+ static ex unarchive(const archive_node &n, const lst &sym_lst);
+
+/** Macro for inclusion in the declaration of each registered class. */
+#define GINAC_DECLARE_REGISTERED_CLASS(classname, supername) \
+ GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(classname, supername) \
+public: \
+ classname(); \
+ ~classname(); \
+ classname(const classname & other); \
+ const classname & operator=(const classname & other); \
+protected: \
+ void copy(const classname & other); \
+ void destroy(bool call_parent); \
private:
-/** Macro for inclusion in the implementation of each registered class. */
-#define GINAC_IMPLEMENT_REGISTERED_CLASS(classname, supername) \
+#define GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(classname, supername) \
registered_class_info classname::reg_info(#classname, #supername, TINFO_##classname, &classname::unarchive); \
const char *classname::class_name(void) const {return reg_info.name;}
+/** Macro for inclusion in the implementation of each registered class. */
+#define GINAC_IMPLEMENT_REGISTERED_CLASS(classname, supername) \
+ GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(classname, supername) \
+classname::~classname() \
+{ \
+ debugmsg(#classname " destructor", LOGLEVEL_DESTRUCT); \
+ destroy(false); \
+} \
+classname::classname(const classname & other) \
+{ \
+ debugmsg(#classname " copy constructor", LOGLEVEL_CONSTRUCT); \
+ copy(other); \
+} \
+const classname & classname::operator=(const classname & other) \
+{ \
+ debugmsg(#classname " operator=", LOGLEVEL_ASSIGNMENT); \
+ if (this != &other) { \
+ destroy(true); \
+ copy(other); \
+ } \
+ return *this; \
+}
/** Find TINFO_* key by class name. */
extern unsigned int find_tinfo_key(const std::string &class_name);
debugmsg("relational default constructor",LOGLEVEL_CONSTRUCT);
}
-relational::~relational()
-{
- debugmsg("relational destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-relational::relational(const relational & other)
-{
- debugmsg("relational copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const relational & relational::operator=(const relational & other)
-{
- debugmsg("relational operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void relational::copy(const relational & other)
greater_or_equal
};
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- relational();
- ~relational();
- relational(const relational & other);
- const relational & operator=(const relational & other);
-protected:
- void copy(const relational & other);
- void destroy(bool call_parent);
-
// other constructors
public:
relational(const ex & lhs, const ex & rhs, operators oper=equal);
#include "simp_lor.h"
#include "ex.h"
#include "mul.h"
+#include "archive.h"
#include "debugmsg.h"
#include "utils.h"
namespace GiNaC {
#endif // ndef NO_NAMESPACE_GINAC
+GINAC_IMPLEMENT_REGISTERED_CLASS(simp_lor, indexed)
+
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
//////////
tinfo_key=TINFO_simp_lor;
}
-simp_lor::~simp_lor()
-{
- debugmsg("simp_lor destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-simp_lor::simp_lor(const simp_lor & other)
-{
- debugmsg("simp_lor copy constructor",LOGLEVEL_CONSTRUCT);
- copy (other);
-}
-
-const simp_lor & simp_lor::operator=(const simp_lor & other)
-{
- debugmsg("simp_lor operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void simp_lor::copy(const simp_lor & other)
GINAC_ASSERT(all_of_type_lorentzidx());
}
+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+simp_lor::simp_lor(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+ debugmsg("simp_lor constructor from archive_node", LOGLEVEL_CONSTRUCT);
+ unsigned int ty;
+ if (!(n.find_unsigned("type", ty)))
+ throw (std::runtime_error("unknown simp_lor type in archive"));
+ type = (simp_lor_types)ty;
+ n.find_string("name", name);
+}
+
+/** Unarchive the object. */
+ex simp_lor::unarchive(const archive_node &n, const lst &sym_lst)
+{
+ return (new simp_lor(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void simp_lor::archive(archive_node &n) const
+{
+ inherited::archive(n);
+ n.add_unsigned("type", type);
+ n.add_string("name", name);
+}
+
+
//////////
// functions overriding virtual functions from bases classes
//////////
/** Base class for simp_lor object */
class simp_lor : public indexed
{
+ GINAC_DECLARE_REGISTERED_CLASS(simp_lor, indexed)
+
// friends
friend class scalar_products;
simp_lor_vec
} simp_lor_types;
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- simp_lor();
- ~simp_lor();
- simp_lor(const simp_lor & other);
- const simp_lor & operator=(const simp_lor & other);
-protected:
- void copy(const simp_lor & other);
- void destroy(bool call_parent);
-
// other constructors
protected:
simp_lor(simp_lor_types const t);
#include <string>
#include "structure.h"
+#include "archive.h"
#include "debugmsg.h"
#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
#endif // ndef NO_NAMESPACE_GINAC
+GINAC_IMPLEMENT_REGISTERED_CLASS(structure, basic)
+
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
//////////
tinfo_key = TINFO_structure;
}
-structure::~structure()
-{
- debugmsg("structure destructor",LOGLEVEL_DESTRUCT);
- destroy(false);
-}
-
-structure::structure(const structure & other)
-{
- debugmsg("structure copy constructor",LOGLEVEL_CONSTRUCT);
- copy(other);
-}
-
-const structure & structure::operator=(const structure & other)
-{
- debugmsg("structure operator=",LOGLEVEL_ASSIGNMENT);
- if (this != &other) {
- destroy(true);
- copy(other);
- }
- return *this;
-}
-
// protected
void structure::copy(const structure & other)
// none
+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+structure::structure(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+ debugmsg("structure constructor from archive_node", LOGLEVEL_CONSTRUCT);
+}
+
+/** Unarchive the object. */
+ex structure::unarchive(const archive_node &n, const lst &sym_lst)
+{
+ return (new structure(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void structure::archive(archive_node &n) const
+{
+ inherited::archive(n);
+}
+
//////////
// structures overriding virtual structures from bases classes
//////////
class structure : public basic
{
-// member functions
-
- // default constructor, destructor, copy constructor assignment operator and helpers
-public:
- structure();
- ~structure();
- structure(const structure & other);
- const structure & operator=(const structure & other);
-protected:
- void copy(const structure & other);
- void destroy(bool call_parent);
+ GINAC_DECLARE_REGISTERED_CLASS(structure, basic)
// other constructors
// none
namespace GiNaC {
#endif // ndef NO_NAMESPACE_GINAC
-GINAC_IMPLEMENT_REGISTERED_CLASS(symbol, basic)
+GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(symbol, basic)
//////////
// default constructor, destructor, copy constructor assignment operator and helpers
* first place. */
class symbol : public basic
{
- GINAC_DECLARE_REGISTERED_CLASS(symbol, basic)
+ GINAC_DECLARE_REGISTERED_CLASS_NO_CTORS(symbol, basic)
// types