* Wrapper template for making GiNaC classes out of C++ structures. */
/*
- * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2011 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
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef __GINAC_STRUCTURE_H__
-#define __GINAC_STRUCTURE_H__
-
-#include <functional>
+#ifndef GINAC_STRUCTURE_H
+#define GINAC_STRUCTURE_H
#include "ex.h"
#include "ncmul.h"
#include "operators.h"
#include "print.h"
-namespace GiNaC {
+#include <functional>
+namespace GiNaC {
/** Comparison policy: all structures of one type are equal */
template <class T>
// helpers
static const char *get_class_name() { return "structure"; }
-
// constructors
public:
/** Construct structure as a copy of a given C++ structure. */
GINAC_ASSERT(is_a<structure>(other));
const structure & o = static_cast<const structure &>(other);
- return struct_is_equal(&obj, &o.obj);
+ return this->struct_is_equal(&obj, &o.obj);
}
unsigned calchash() const { return inherited::calchash(); }
template <class T, template <class> class CP>
structure<T, CP>::structure() { }
-/** Construct object from archive_node. */
-template <class T, template <class> class CP>
-structure<T, CP>::structure(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst) {}
-
-/** Unarchive the object. */
-template <class T, template <class> class CP>
-ex structure<T, CP>::unarchive(const archive_node &n, lst &sym_lst)
-{
- return (new structure(n, sym_lst))->setflag(status_flags::dynallocated);
-}
-
-/** Archive the object. */
-template <class T, template <class> class CP>
-void structure<T, CP>::archive(archive_node &n) const
-{
- inherited::archive(n);
-}
-
/** Compare two structures of the same type. */
template <class T, template <class> class CP>
int structure<T, CP>::compare_same_type(const basic & other) const
GINAC_ASSERT(is_a<structure>(other));
const structure & o = static_cast<const structure &>(other);
- return struct_compare(&obj, &o.obj);
+ return this->struct_compare(&obj, &o.obj);
}
template <class T, template <class> class CP>
-registered_class_info structure<T, CP>::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", typeid(structure<T, CP>), &structure::unarchive));
-
+registered_class_info structure<T, CP>::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", typeid(structure<T, CP>)));
} // namespace GiNaC
-#endif // ndef __GINAC_STRUCTURE_H__
+#endif // ndef GINAC_STRUCTURE_H