00001
00002
00003 #ifndef GAUDIPYTHON_PRINTER_H
00004 #define GAUDIPYTHON_PRINTER_H 1
00005
00006
00007
00008
00009
00010 #include <string>
00011 #include <sstream>
00012
00013
00014
00015 #include "GaudiKernel/ContainedObject.h"
00016 #include "GaudiKernel/DataObject.h"
00017
00018
00019 namespace GaudiPython
00020 {
00027 template <class TYPE>
00028 struct Printer
00029 {
00030 static std::string print
00031 ( const TYPE& object )
00032 {
00033 std::stringstream stream ;
00034 stream << object << std::endl ;
00035 return stream.str() ;
00036 } ;
00037 } ;
00038 template<>
00039 struct Printer<ContainedObject>
00040 {
00041 static std::string print
00042 ( const ContainedObject& object )
00043 {
00044 std::ostringstream stream ;
00045 object.fillStream( stream ) ;
00046 return stream.str() ;
00047 } ;
00048 } ;
00049 template<>
00050 struct Printer<DataObject>
00051 {
00052 static std::string print ( const DataObject& type )
00053 {
00054 std::ostringstream stream ;
00055 type.fillStream( stream ) ;
00056 return stream.str() ;
00057 } ;
00058 };
00059
00060 };
00061
00062 #endif // GAUDIPYTHON_PRINTER_H
00063