X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fstructure.cpp;h=c8c0e2b0dd7812859720b93da8b1d2a8748f9d03;hp=c084096c49ff3d8509924d87ef4174e0ff934c89;hb=e65326821bb7f9c4054f35caef46039f1963e951;hpb=06eb6b761f4b9d9eed4decd8ed50d94b40b94a0e diff --git a/ginac/structure.cpp b/ginac/structure.cpp index c084096c..c8c0e2b0 100644 --- a/ginac/structure.cpp +++ b/ginac/structure.cpp @@ -3,7 +3,7 @@ * Implementation of 'abstract' class structure. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2002 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 @@ -20,19 +20,20 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "structure.h" #include "archive.h" -#include "debugmsg.h" #include "utils.h" +#include "print.h" namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS(structure, basic) ////////// -// default ctor, dtor, copy ctor assignment operator and helpers +// default ctor, dtor, copy ctor, assignment operator and helpers ////////// DEFAULT_CTORS(structure) @@ -44,36 +45,19 @@ DEFAULT_CTORS(structure) DEFAULT_ARCHIVING(structure) ////////// -// functions overriding virtual functions from bases classes +// functions overriding virtual functions from base classes ////////// -void structure::printraw(std::ostream & os) const +void structure::print(const print_context & c, unsigned level) const { - debugmsg("structure printraw",LOGLEVEL_PRINT); + if (is_a(c)) { - os << class_name() << "(hash=" << hashvalue << ",flags=" << flags << ")"; -} - -void structure::print(std::ostream & os, unsigned upper_precedence) const -{ - debugmsg("structure print",LOGLEVEL_PRINT); - - os << class_name() << "()"; -} - -void structure::printtree(std::ostream & os, unsigned indent) const -{ - debugmsg("structure printtree",LOGLEVEL_PRINT); - - os << std::string(indent,' ') << class_name() << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec - << std::endl; -} - -void structure::printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence) const -{ - debugmsg("structure print csrc",LOGLEVEL_PRINT); + c.s << std::string(level, ' ') << class_name() + << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec + << std::endl; - os << "structure()"; + } else + c.s << class_name() << "()"; } // protected @@ -82,7 +66,7 @@ DEFAULT_COMPARE(structure) bool structure::is_equal_same_type(const basic & other) const { - GINAC_ASSERT(is_of_type(other, structure)); + GINAC_ASSERT(is_a(other)); return true; // all structures are the same }