]> www.ginac.de Git - ginac.git/blobdiff - ginac/archive.cpp
documentation update
[ginac.git] / ginac / archive.cpp
index 2dc14f672c2f8252b6e62f5ab50ca4c39bd2f3d2..16e3946fb7fdb8e900d15bf7875b19b9bec29c43 100644 (file)
@@ -3,7 +3,7 @@
  *  Archiving of GiNaC expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2003 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
@@ -26,6 +26,7 @@
 #include "archive.h"
 #include "registrar.h"
 #include "ex.h"
+#include "lst.h"
 #include "config.h"
 #include "tostring.h"
 
@@ -89,7 +90,8 @@ ex archive::unarchive_ex(const lst &sym_lst, const char *name) const
 
 found:
        // Recursively unarchive all nodes, starting at the root node
-       return nodes[i->root].unarchive(sym_lst);
+       lst sym_lst_copy = sym_lst;
+       return nodes[i->root].unarchive(sym_lst_copy);
 }
 
 ex archive::unarchive_ex(const lst &sym_lst, unsigned index) const
@@ -98,7 +100,8 @@ ex archive::unarchive_ex(const lst &sym_lst, unsigned index) const
                throw (std::range_error("index of archived expression out of range"));
 
        // Recursively unarchive all nodes, starting at the root node
-       return nodes[exprs[index].root].unarchive(sym_lst);
+       lst sym_lst_copy = sym_lst;
+       return nodes[exprs[index].root].unarchive(sym_lst_copy);
 }
 
 ex archive::unarchive_ex(const lst &sym_lst, std::string &name, unsigned index) const
@@ -110,7 +113,8 @@ ex archive::unarchive_ex(const lst &sym_lst, std::string &name, unsigned index)
        name = unatomize(exprs[index].name);
 
        // Recursively unarchive all nodes, starting at the root node
-       return nodes[exprs[index].root].unarchive(sym_lst);
+       lst sym_lst_copy = sym_lst;
+       return nodes[exprs[index].root].unarchive(sym_lst_copy);
 }
 
 unsigned archive::num_expressions(void) const
@@ -316,18 +320,11 @@ const std::string &archive::unatomize(archive_atom id) const
 }
 
 
-/** Copy constructor of archive_node. */
-archive_node::archive_node(const archive_node &other)
-  : a(other.a), props(other.props), has_expression(other.has_expression), e(other.e)
-{
-}
-
-
 /** Assignment operator of archive_node. */
 const archive_node &archive_node::operator=(const archive_node &other)
 {
        if (this != &other) {
-               a = other.a;
+               // archive &a member doesn't get copied
                props = other.props;
                has_expression = other.has_expression;
                e = other.e;
@@ -432,7 +429,7 @@ bool archive_node::find_string(const std::string &name, std::string &ret, unsign
        return false;
 }
 
-bool archive_node::find_ex(const std::string &name, ex &ret, const lst &sym_lst, unsigned index) const
+bool archive_node::find_ex(const std::string &name, ex &ret, lst &sym_lst, unsigned index) const
 {
        archive_atom name_atom = a.atomize(name);
        std::vector<property>::const_iterator i = props.begin(), iend = props.end();
@@ -493,7 +490,7 @@ void archive_node::get_properties(propinfovector &v) const
 
 
 /** Convert archive node to GiNaC expression. */
-ex archive_node::unarchive(const lst &sym_lst) const
+ex archive_node::unarchive(lst &sym_lst) const
 {
        // Already unarchived? Then return cached unarchived expression.
        if (has_expression)
@@ -512,29 +509,6 @@ ex archive_node::unarchive(const lst &sym_lst) const
 }
 
 
-/** Assignment operator of property_info. */
-const archive_node::property_info &archive_node::property_info::operator=(const property_info &other)
-{
-       if (this != &other) {
-               type = other.type;
-               name = other.name;
-               count = other.count;
-       }
-       return *this;
-}
-
-/** Assignment operator of property. */
-const archive_node::property &archive_node::property::operator=(const property &other)
-{
-       if (this != &other) {
-               type = other.type;
-               name = other.name;
-               value = other.value;
-       }
-       return *this;
-}
-
-
 void archive::clear(void)
 {
        atoms.clear();