The Gaudi Framework  v30r3 (a5ef0a68)
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 <sstream>
9 #include <string>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
14 #include "GaudiKernel/DataObject.h"
15 // ============================================================================
16 
17 namespace GaudiPython
18 {
25  template <class TYPE>
26  struct Printer {
27  static std::string print( const TYPE& object )
28  {
29  std::stringstream stream;
30  stream << object << std::endl;
31  return stream.str();
32  };
33  };
34  template <>
36  static std::string print( const ContainedObject& object )
37  {
38  std::ostringstream stream;
39  object.fillStream( stream );
40  return stream.str();
41  };
42  };
43  template <>
44  struct Printer<DataObject> {
45  static std::string print( const DataObject& type )
46  {
47  std::ostringstream stream;
48  type.fillStream( stream );
49  return stream.str();
50  };
51  };
52 
53 } // end of namespace GaudiPython
54 
55 #endif // GAUDIPYTHON_PRINTER_H
56 // ============================================================================
T endl(T...args)
STL class.
static std::string print(const ContainedObject &object)
Definition: Printer.h:36
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:83
T str(T...args)
static std::string print(const DataObject &type)
Definition: Printer.h:45
GaudiPython.h GaudiPython/GaudiPython.h.
Definition: __init__.py:1
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
static std::string print(const TYPE &object)
Definition: Printer.h:27
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30