| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 // ============================================================================
std::endl
T endl(T...args)
std::stringstream
STL class.
std::string
STL class.
DataObject::fillStream
virtual std::ostream & fillStream(std::ostream &s) const
Fill the output stream (ASCII)
Definition: DataObject.h:94
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:125
std::stringstream::str
T str(T...args)
GaudiPython::Printer< DataObject >::print
static std::string print(const DataObject &type)
Definition: Printer.h:50
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:29
GaudiPython::Printer
Definition: Printer.h:26
ContainedObject.h
GaudiPython::Printer::print
static std::string print(const TYPE &object)
Definition: Printer.h:29
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
DataObject.h