Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
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 <sstream>
9 #include <string>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
14 #include "GaudiKernel/DataObject.h"
15 // ============================================================================
16 
17 namespace GaudiPython {
24  template <class TYPE>
25  struct Printer {
26  static std::string print( const TYPE& object ) {
27  std::stringstream stream;
28  stream << object << std::endl;
29  return stream.str();
30  };
31  };
32  template <>
34  static std::string print( const ContainedObject& object ) {
35  std::ostringstream stream;
36  object.fillStream( stream );
37  return stream.str();
38  };
39  };
40  template <>
41  struct Printer<DataObject> {
42  static std::string print( const DataObject& type ) {
43  std::ostringstream stream;
44  type.fillStream( stream );
45  return stream.str();
46  };
47  };
48 
49 } // end of namespace GaudiPython
50 
51 #endif // GAUDIPYTHON_PRINTER_H
T endl(T...args)
STL class.
static std::string print(const ContainedObject &object)
Definition: Printer.h:34
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:82
T str(T...args)
static std::string print(const DataObject &type)
Definition: Printer.h:42
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:26
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30