| The Gaudi Framework v32r1 (f65d50dc)

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 // ============================================================================
13 #include "GaudiKernel/ContainedObject.h"
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 <>
33 struct Printer<ContainedObject> {
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
std::endl
T endl(T... args)
std::stringstream
STL class.
std::string
STL class.
GaudiPython::Printer< ContainedObject >::print
static std::string print(const ContainedObject &object)
Definition: Printer.h:34
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:142
std::stringstream::str
T str(T... args)
GaudiPython::Printer< DataObject >::print
static std::string print(const DataObject &type)
Definition: Printer.h:42
GaudiPython
GaudiPython.h GaudiPython/GaudiPython.h.
Definition: AlgDecorators.h:37
ContainedObject
All classes that their objects may be contained in an LHCb ObjectContainer (e.g.
Definition: ContainedObject.h:31
GaudiPython::Printer
Definition: Printer.h:25
ContainedObject.h
GaudiPython::Printer::print
static std::string print(const TYPE &object)
Definition: Printer.h:26
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataObject.h