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