CMS 3D CMS Logo

Classes | Functions | Variables
cond::payloadInspector Namespace Reference

Classes

class  Histogram1D
 
class  Histogram2D
 
class  HistoryPlot
 
struct  ModuleVersion
 
class  Plot2D
 
class  Plot3D
 
struct  PlotAnnotations
 
class  PlotBase
 
class  PlotImage
 
class  RunHistoryPlot
 
class  ScatterPlot
 
class  TimeHistoryPlot
 

Functions

template<typename X , typename Y >
std::string serialize (const PlotAnnotations &annotations, const std::vector< std::tuple< X, Y > > &data)
 
template<typename X , typename Y , typename Z >
std::string serialize (const PlotAnnotations &annotations, const std::vector< std::tuple< X, Y, Z > > &data)
 
std::string serialize (const PlotAnnotations &annotations, const std::string &imageFileName)
 
std::string serializeAnnotations (const PlotAnnotations &annotations)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const V &value)
 
template<>
std::string serializeValue (const std::string &entryLabel, const std::string &value)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const std::tuple< V, std::string > &value)
 
template<typename V >
std::string serializeValue (const std::string &entryLabel, const std::pair< V, V > &value)
 

Variables

static const char *const JSON_FORMAT_VERSION = "1.0"
 

Function Documentation

template<typename X , typename Y >
std::string cond::payloadInspector::serialize ( const PlotAnnotations annotations,
const std::vector< std::tuple< X, Y > > &  data 
)

Definition at line 88 of file PayloadInspector.h.

References ztail::d, data, dqmdumpme::first, serializeAnnotations(), serializeValue(), and contentValuesCheck::ss.

Referenced by cond::payloadInspector::Plot2D< PayloadType, float, float >::serializeData(), cond::payloadInspector::Plot3D< PayloadType, float, float, float >::serializeData(), and cond::payloadInspector::PlotImage< PayloadType >::serializeData().

88  {
89  // prototype implementation...
90  std::stringstream ss;
91  ss << "{";
92  ss << serializeAnnotations(annotations);
93  ss << ",";
94  ss << "\"data\": [";
95  bool first = true;
96  for (auto d : data) {
97  if (!first)
98  ss << ",";
99  ss << " { " << serializeValue("x", std::get<0>(d)) << ", " << serializeValue("y", std::get<1>(d)) << " }";
100  first = false;
101  }
102  ss << "]";
103  ss << "}";
104  return ss.str();
105  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
d
Definition: ztail.py:151
std::string serializeAnnotations(const PlotAnnotations &annotations)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
template<typename X , typename Y , typename Z >
std::string cond::payloadInspector::serialize ( const PlotAnnotations annotations,
const std::vector< std::tuple< X, Y, Z > > &  data 
)

Definition at line 108 of file PayloadInspector.h.

References ztail::d, data, dqmdumpme::first, serializeAnnotations(), serializeValue(), and contentValuesCheck::ss.

108  {
109  // prototype implementation...
110  std::stringstream ss;
111  ss << "{";
112  ss << serializeAnnotations(annotations);
113  ss << ",";
114  ss << "\"data\": [";
115  bool first = true;
116  for (auto d : data) {
117  if (!first)
118  ss << ",";
119  ss << " { " << serializeValue("x", std::get<0>(d)) << ", " << serializeValue("y", std::get<1>(d)) << ", "
120  << serializeValue("z", std::get<2>(d)) << " }";
121  first = false;
122  }
123  ss << "]";
124  ss << "}";
125  return ss.str();
126  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
d
Definition: ztail.py:151
std::string serializeAnnotations(const PlotAnnotations &annotations)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::string cond::payloadInspector::serialize ( const PlotAnnotations annotations,
const std::string &  imageFileName 
)

Definition at line 128 of file PayloadInspector.h.

References serializeAnnotations(), and contentValuesCheck::ss.

128  {
129  std::stringstream ss;
130  ss << "{";
131  ss << serializeAnnotations(annotations);
132  ss << ",";
133  ss << "\"file\": \"" << imageFileName << "\"";
134  ss << "}";
135  return ss.str();
136  }
std::string serializeAnnotations(const PlotAnnotations &annotations)
std::string cond::payloadInspector::serializeAnnotations ( const PlotAnnotations annotations)

Definition at line 72 of file PayloadInspector.h.

References a, dqmdumpme::first, cond::payloadInspector::PlotAnnotations::m, and contentValuesCheck::ss.

Referenced by serialize().

72  {
73  std::stringstream ss;
74  ss << "\"version\": \"" << JSON_FORMAT_VERSION << "\",";
75  ss << "\"annotations\": {";
76  bool first = true;
77  for (auto a : annotations.m) {
78  if (!first)
79  ss << ",";
80  ss << "\"" << a.first << "\":\"" << a.second << "\"";
81  first = false;
82  }
83  ss << "}";
84  return ss.str();
85  }
static const char *const JSON_FORMAT_VERSION
double a
Definition: hdecay.h:119
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const V &  value 
)

Definition at line 39 of file PayloadInspector.h.

References contentValuesCheck::ss, and relativeConstraints::value.

Referenced by serialize(), and serializeValue().

39  {
40  std::stringstream ss;
41  ss << "\"" << entryLabel << "\":" << value;
42  return ss.str();
43  }
template<>
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::string &  value 
)

Definition at line 46 of file PayloadInspector.h.

References contentValuesCheck::ss.

46  {
47  std::stringstream ss;
48  ss << "\"" << entryLabel << "\":\"" << value << "\"";
49  return ss.str();
50  }
Definition: value.py:1
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::tuple< V, std::string > &  value 
)

Definition at line 54 of file PayloadInspector.h.

References serializeValue(), contentValuesCheck::ss, and relativeConstraints::value.

54  {
55  std::stringstream ss;
56  ss << serializeValue(entryLabel, std::get<0>(value));
57  ss << ", ";
58  ss << serializeValue(entryLabel + "_label", std::get<1>(value));
59  return ss.str();
60  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
Definition: value.py:1
template<typename V >
std::string cond::payloadInspector::serializeValue ( const std::string &  entryLabel,
const std::pair< V, V > &  value 
)

Definition at line 64 of file PayloadInspector.h.

References serializeValue(), and contentValuesCheck::ss.

64  {
65  std::stringstream ss;
66  ss << serializeValue(entryLabel, value.first);
67  ss << ", ";
68  ss << serializeValue(entryLabel + "_err", value.second);
69  return ss.str();
70  }
std::string serializeValue(const std::string &entryLabel, const std::pair< V, V > &value)
Definition: value.py:1

Variable Documentation

const char* const cond::payloadInspector::JSON_FORMAT_VERSION = "1.0"
static

Definition at line 35 of file PayloadInspector.h.