]> www.ginac.de Git - ginac.git/blobdiff - ginac/structure.h
Prettified source code.
[ginac.git] / ginac / structure.h
index 6c08618c7c4a7752e4033b0db2dbe65213ec3456..6cefe0c8b7f48462e2f073116a666d35a8a6378d 100644 (file)
@@ -3,7 +3,7 @@
  *  Wrapper template for making GiNaC classes out of C++ structures. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2009 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"
@@ -31,8 +29,9 @@
 #include "operators.h"
 #include "print.h"
 
-namespace GiNaC {
+#include <functional>
 
+namespace GiNaC {
 
 /** Comparison policy: all structures of one type are equal */
 template <class T>
@@ -117,13 +116,11 @@ class structure : public basic, public ComparisonPolicy<T> {
        GINAC_DECLARE_REGISTERED_CLASS(structure, basic)
 
        // helpers
-       static tinfo_t get_tinfo() { return reg_info.options.get_id(); }
        static const char *get_class_name() { return "structure"; }
-
        // constructors
 public:
        /** Construct structure as a copy of a given C++ structure. */
-       structure(const T & t) : inherited(get_tinfo()), obj(t) { }
+       structure(const T & t) : obj(t) { }
 
        // functions overriding virtual functions from base classes
        // All these are just defaults that can be specialized by the user
@@ -231,25 +228,7 @@ private:
 
 /** Default constructor */
 template <class T, template <class> class CP>
-structure<T, CP>::structure() : inherited(get_tinfo()) { }
-
-/** 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);
-}
+structure<T, CP>::structure() { }
 
 /** Compare two structures of the same type. */
 template <class T, template <class> class CP>
@@ -262,9 +241,8 @@ int structure<T, CP>::compare_same_type(const basic & other) const
 }
 
 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