X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcontainer.h;h=e3465c46decb803392b255cc1c364c5df9b51d08;hp=88ccd6a0adec63d4800abea17db8cd36d327d701;hb=6d7bf9ee5a7ce05cb3a23dae664e781d7325d7b8;hpb=757406e244f4f257aafaa0f355d5376122cea10e diff --git a/ginac/container.h b/ginac/container.h index 88ccd6a0..e3465c46 100644 --- a/ginac/container.h +++ b/ginac/container.h @@ -28,6 +28,7 @@ #include #include #include +#include #include "ex.h" #include "print.h" @@ -93,11 +94,9 @@ public: this->seq = s; } - explicit container(STLT * vp) : inherited(get_tinfo()) + explicit container(std::auto_ptr vp) : inherited(get_tinfo()) { - GINAC_ASSERT(vp); this->seq.swap(*vp); - delete vp; } container(exvector::const_iterator b, exvector::const_iterator e) @@ -268,7 +267,6 @@ public: // functions overriding virtual functions from base classes public: - void print(const print_context & c, unsigned level = 0) const; bool info(unsigned inf) const { return inherited::info(inf); } unsigned precedence() const { return 10; } size_t nops() const { return this->seq.size(); } @@ -288,7 +286,7 @@ protected: /** Similar to duplicate(), but with a preset sequence (which gets * deleted). Must be overridden by derived classes. */ - virtual ex thiscontainer(STLT * vp) const { return container(vp); } + virtual ex thiscontainer(std::auto_ptr vp) const { return container(vp); } virtual void printseq(const print_context & c, char openbracket, char delim, char closebracket, unsigned this_precedence, @@ -327,8 +325,12 @@ public: const_reverse_iterator rend() const {return this->seq.rend();} protected: + 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(const print_python & c, unsigned level) const; + void do_print_python_repr(const print_python_repr & c, unsigned level) const; STLT evalchildren(int level) const; - STLT *subschildren(const exmap & m, unsigned options = 0) const; + std::auto_ptr subschildren(const exmap & m, unsigned options = 0) const; }; /** Default constructor */ @@ -368,29 +370,38 @@ void container::archive(archive_node &n) const } template