CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
payloadInspectorTemplate.py
Go to the documentation of this file.
1 buildfileTemplate = """
2 <library file="$_CLASS_NAME_-PyWrapper.cc" name=$_CLASS_NAME_-PyInterface>
3 <use name=CondCore/Utilities>
4 <use name=CondFormats/$_PACKAGE_>
5 <use name=boost>
6 <use name=boost_filesystem>
7 <use name=boost_python>
8 <use name=boost_regex>
9 <flags EDM_PLUGIN=1>
10 </library>
11 """
12 
13 wrapperTemplate = """
14 #include "CondFormats/$_PACKAGE_/interface/$_HEADER_FILE_.h"
15 
16 #include "CondCore/Utilities/interface/PayLoadInspector.h"
17 #include "CondCore/Utilities/interface/InspectorPythonWrapper.h"
18 
19 #include <string>
20 #include <fstream>
21 
22 namespace cond {
23 
24  template<>
25  class ValueExtractor<$_CLASS_NAME_>: public BaseValueExtractor<$_CLASS_NAME_> {
26  public:
27 
28  typedef $_CLASS_NAME_ Class;
29  typedef ExtractWhat<Class> What;
30  static What what() { return What();}
31 
32  ValueExtractor(){}
33  ValueExtractor(What const & what)
34  {
35  // here one can make stuff really complicated...
36  }
37  void compute(Class const & it){
38  }
39  private:
40 
41  };
42 
43 
44  template<>
45  std::string
46  PayLoadInspector<$_CLASS_NAME_>::dump() const {
47  std::stringstream ss;
48  return ss.str();
49 
50  }
51 
52  template<>
53  std::string PayLoadInspector<$_CLASS_NAME_>::summary() const {
54  std::stringstream ss;
55  return ss.str();
56  }
57 
58 
59  template<>
60  std::string PayLoadInspector<$_CLASS_NAME_>::plot(std::string const & filename,
61  std::string const &,
62  std::vector<int> const&,
63  std::vector<float> const& ) const {
64  std::string fname = filename + ".png";
65  std::ofstream f(fname.c_str());
66  return fname;
67  }
68 
69 
70 }
71 
72 PYTHON_WRAPPER($_CLASS_NAME_,$_CLASS_NAME_);
73 """