All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Printer.h
Go to the documentation of this file.
1 #ifndef GAUDIPYTHON_PRINTER_H
2 #define GAUDIPYTHON_PRINTER_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <string>
9 #include <sstream>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
13 #include "GaudiKernel/ContainedObject.h"
14 #include "GaudiKernel/DataObject.h"
15 // ============================================================================
16 
17 namespace GaudiPython
18 {
25  template <class TYPE>
26  struct Printer
27  {
28  static std::string print
29  ( const TYPE& object )
30  {
31  std::stringstream stream ;
32  stream << object << std::endl ;
33  return stream.str() ;
34  } ;
35  } ;
36  template<>
37  struct Printer<ContainedObject>
38  {
39  static std::string print
40  ( const ContainedObject& object )
41  {
42  std::ostringstream stream ;
43  object.fillStream( stream ) ;
44  return stream.str() ;
45  } ;
46  } ;
47  template<>
48  struct Printer<DataObject>
49  {
50  static std::string print ( const DataObject& type )
51  {
52  std::ostringstream stream ;
53  type.fillStream( stream ) ;
54  return stream.str() ;
55  } ;
56  };
57 
58 } // end of namespace GaudiPython
59 
60 #endif // GAUDIPYTHON_PRINTER_H
61 // ============================================================================
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:94
GaudiPython.h GaudiPython/GaudiPython.h.
Definition: AlgDecorators.h:37
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
static std::string print(const TYPE &object)
Definition: Printer.h:29
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
string type
Definition: gaudirun.py:151