]> www.ginac.de Git - ginac.git/blobdiff - ginac/function.pl
Univariate Hensel lifting now uses upoly.
[ginac.git] / ginac / function.pl
index 6c70d2dd52137b26a6cb7b361e786dcc063379e8..3ac3c3cab9e23549b35696f951dd3e307d0df278 100644 (file)
@@ -514,6 +514,8 @@ public:
        ex conjugate() const;
        ex real_part() const;
        ex imag_part() const;
+       void archive(archive_node& n) const;
+       void read_archive(const archive_node& n, lst& syms);
 protected:
        ex derivative(const symbol & s) const;
        bool is_equal_same_type(const basic & other) const;
@@ -543,6 +545,7 @@ public:
 protected:
        unsigned serial;
 };
+GINAC_DECLARE_UNARCHIVER(function);
 
 // utility functions/macros
 
@@ -852,8 +855,9 @@ function::function(unsigned ser, std::auto_ptr<exvector> vp)
 //////////
 
 /** Construct object from archive_node. */
-function::function(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst)
+void function::read_archive(const archive_node& n, lst& sym_lst)
 {
+       inherited::read_archive(n, sym_lst);
        // Find serial number by function name
        std::string s;
        if (n.find_string("name", s)) {
@@ -871,12 +875,6 @@ function::function(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst)
                throw (std::runtime_error("unnamed function in archive"));
 }
 
-/** Unarchive the object. */
-ex function::unarchive(const archive_node &n, lst &sym_lst)
-{
-       return (new function(n, sym_lst))->setflag(status_flags::dynallocated);
-}
-
 /** Archive the object. */
 void function::archive(archive_node &n) const
 {
@@ -885,6 +883,8 @@ void function::archive(archive_node &n) const
        n.add_string("name", registered_functions()[serial].name);
 }
 
+GINAC_BIND_UNARCHIVER(function);
+
 //////////
 // functions overriding virtual functions from base classes
 //////////