X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fbasic.h;h=d50c7ca34eb73d916e9f93fb2c38d3d28e0a71e6;hb=3791fff10fec1552ac740a7690f7a7a4b59e82f5;hp=1d81c6e19bc2f6ced70962e468fa7bac5ad824ab;hpb=0f7b8280ad89fa88a0cbaab7785a4b7cb06e6a63;p=ginac.git diff --git a/ginac/basic.h b/ginac/basic.h index 1d81c6e1..d50c7ca3 100644 --- a/ginac/basic.h +++ b/ginac/basic.h @@ -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 + 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 -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