]> www.ginac.de Git - ginac.git/blobdiff - ginac/archive.h
Reset GINAC_LT_AGE to bump SONAME.
[ginac.git] / ginac / archive.h
index f78e593a97d5c4667d9551117e8fd25bdb8319e6..603bd81c8775d8e4b7f1fef627423c7f95347e93 100644 (file)
@@ -3,7 +3,7 @@
  *  Archiving of GiNaC expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2020 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
@@ -82,8 +82,10 @@ public:
                unsigned value;     /**< Stored value. */
        };
        typedef std::vector<property>::const_iterator archive_node_cit;
+       struct archive_node_cit_range {
+               archive_node_cit begin, end;
+       };
 
-       archive_node() : a(*dummy_ar_creator()), has_expression(false) {} // hack for cint which always requires a default constructor
        archive_node(archive &ar) : a(ar), has_expression(false) {}
        archive_node(archive &ar, const ex &expr);
 
@@ -114,17 +116,22 @@ public:
        bool find_string(const std::string &name, std::string &ret, unsigned index = 0) const;
 
        /** Find the location in the vector of properties of the first/last
-    *  property with a given name. */
+        *  property with a given name. */
        archive_node_cit find_first(const std::string &name) const;
        archive_node_cit find_last(const std::string &name) const;
 
+       /** Find a range of locations in the vector of properties. The result
+        *  begins at the first property with name1 and ends one past the last
+        *  property with name2. */
+       archive_node_cit_range find_property_range(const std::string &name1, const std::string &name2) const;
+
        /** Retrieve property of type "ex" from node.
         *  @return "true" if property was found, "false" otherwise */
        bool find_ex(const std::string &name, ex &ret, lst &sym_lst, unsigned index = 0) const;
 
        /** Retrieve property of type "ex" from the node if it is known
-    *  that this node in fact contains such a property at the given
-    *  location. This is much more efficient than the preceding function. */
+        *  that this node in fact contains such a property at the given
+        *  location. This is much more efficient than the preceding function. */
        void find_ex_by_loc(archive_node_cit loc, ex &ret, lst &sym_lst) const;
 
        /** Retrieve property of type "ex" from node, returning the node of
@@ -143,8 +150,6 @@ public:
        void printraw(std::ostream &os) const;
 
 private:
-       static archive* dummy_ar_creator();
-
        /** Reference to the archive to which this node belongs. */
        archive &a;
 
@@ -274,14 +279,14 @@ public:
        /** Retrieve expression from archive by index.
         *  @param sym_lst list of pre-defined symbols
         *  @param index index of expression
-     *  @see count_expressions */
+        *  @see count_expressions */
        ex unarchive_ex(const lst &sym_lst, unsigned index = 0) const;
 
        /** Retrieve expression and its name from archive by index.
         *  @param sym_lst list of pre-defined symbols
         *  @param name receives the name of the expression
         *  @param index index of expression
-     *  @see count_expressions */
+        *  @see count_expressions */
        ex unarchive_ex(const lst &sym_lst, std::string &name, unsigned index = 0) const;
 
        /** Return number of archived expressions. */
@@ -329,7 +334,6 @@ private:
        mutable std::map<std::string, archive_atom> inverse_atoms;
 
        /** Map of stored expressions to nodes for faster archiving */
-       typedef std::map<ex, archive_node_id, ex_is_less>::iterator mapit;
        mutable std::map<ex, archive_node_id, ex_is_less> exprtable;
 };