]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.h
location of C++ FAQ Lite has changed
[ginac.git] / ginac / basic.h
index 1d81c6e19bc2f6ced70962e468fa7bac5ad824ab..d50c7ca34eb73d916e9f93fb2c38d3d28e0a71e6 100644 (file)
@@ -192,6 +192,19 @@ protected: // functions that should be called from class ex only
        
        // non-virtual functions in this class
 public:
+       /** Like print(), but dispatch to the specified class. Can be used by
+        *  implementations of print methods to dispatch to the method of the
+        *  superclass.
+        *
+        *  @see basic::print */
+       template <class T>
+       void print_dispatch(const print_context & c, unsigned level) const
+       {
+               print_dispatch(T::get_class_info_static(), c, level);
+       }
+
+       void print_dispatch(const registered_class_info & ri, const print_context & c, unsigned level) const;
+
        ex subs_one_level(const exmap & m, unsigned options) const;
        ex diff(const symbol & s, unsigned nth = 1) const;
        int compare(const basic & other) const;
@@ -208,6 +221,10 @@ public:
 
 protected:
        void ensure_if_modifiable() const;
+
+       void do_print(const print_context & c, unsigned level) const;
+       void do_print_tree(const print_tree & c, unsigned level) const;
+       void do_print_python_repr(const print_python_repr & c, unsigned level) const;
        
        // member variables
 protected:
@@ -237,9 +254,9 @@ inline bool is_a(const basic &obj)
  *  inefficient default.  It should in all time-critical cases be overridden
  *  by template specializations that use the TINFO_* constants directly. */
 template <class T>
-inline bool is_exactly_a(const class basic &obj)
+inline bool is_exactly_a(const basic &obj)
 {
-       return obj.tinfo() == T::reg_info.tinfo_key;
+       return obj.tinfo() == T::get_class_info_static().options.get_id();
 }
 
 } // namespace GiNaC