]> www.ginac.de Git - ginac.git/blobdiff - ginac/structure.cpp
- epsilon*epsilon contractions work
[ginac.git] / ginac / structure.cpp
index c084096c49ff3d8509924d87ef4174e0ff934c89..e1ea6d56577349461171b03969942affcb68c5cd 100644 (file)
@@ -26,6 +26,7 @@
 #include "archive.h"
 #include "debugmsg.h"
 #include "utils.h"
+#include "print.h"
 
 namespace GiNaC {
 
@@ -44,36 +45,21 @@ 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
-{
-       debugmsg("structure printraw",LOGLEVEL_PRINT);
-
-       os << class_name() << "(hash=" << hashvalue << ",flags=" << flags << ")";
-}
-
-void structure::print(std::ostream & os, unsigned upper_precedence) const
+void structure::print(const print_context & c, unsigned level) const
 {
        debugmsg("structure print",LOGLEVEL_PRINT);
 
-       os << class_name() << "()";
-}
-
-void structure::printtree(std::ostream & os, unsigned indent) const
-{
-       debugmsg("structure printtree",LOGLEVEL_PRINT);
+       if (is_of_type(c, print_tree)) {
 
-       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