CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cond::utilities::JsonPrinter Class Reference

#include <JsonPrinter.h>

Public Member Functions

void append (const std::string &xValue, const std::string &yValue, const std::string &yError)
 
void append (const std::string &xValue, const std::string &yValue)
 
 JsonPrinter ()
 
 JsonPrinter (const std::string &xName, const std::string &yName)
 
std::string print ()
 
virtual ~JsonPrinter ()
 

Private Attributes

std::vector< std::tuple
< std::string, std::string,
std::string > > 
m_values
 
std::string m_xName = "X"
 
std::string m_yName = "Y"
 

Detailed Description

Definition at line 12 of file JsonPrinter.h.

Constructor & Destructor Documentation

cond::utilities::JsonPrinter::JsonPrinter ( )

Definition at line 9 of file JsonPrinter.cc.

9 :m_values(){}
std::vector< std::tuple< std::string, std::string, std::string > > m_values
Definition: JsonPrinter.h:27
cond::utilities::JsonPrinter::JsonPrinter ( const std::string &  xName,
const std::string &  yName 
)

Definition at line 11 of file JsonPrinter.cc.

11  :
12  m_xName(xName),
13  m_yName(yName),
14  m_values(){
15  }
std::vector< std::tuple< std::string, std::string, std::string > > m_values
Definition: JsonPrinter.h:27
virtual cond::utilities::JsonPrinter::~JsonPrinter ( )
inlinevirtual

Definition at line 17 of file JsonPrinter.h.

17 {}

Member Function Documentation

void cond::utilities::JsonPrinter::append ( const std::string &  xValue,
const std::string &  yValue,
const std::string &  yError 
)

Definition at line 17 of file JsonPrinter.cc.

References m_values.

Referenced by diclist.diclist::add(), Vispa.Views.PropertyView.PropertyView::addProperty(), and BeautifulSoup.Tag::setString().

17  {
18  m_values.push_back( std::make_tuple( xValue, yValue, yError ) );
19  }
std::vector< std::tuple< std::string, std::string, std::string > > m_values
Definition: JsonPrinter.h:27
void cond::utilities::JsonPrinter::append ( const std::string &  xValue,
const std::string &  yValue 
)

Definition at line 21 of file JsonPrinter.cc.

References m_values.

Referenced by diclist.diclist::add(), Vispa.Views.PropertyView.PropertyView::addProperty(), and BeautifulSoup.Tag::setString().

21  {
22  m_values.push_back( std::make_tuple( xValue, yValue, "0" ) );
23  }
std::vector< std::tuple< std::string, std::string, std::string > > m_values
Definition: JsonPrinter.h:27
std::string cond::utilities::JsonPrinter::print ( void  )

Definition at line 25 of file JsonPrinter.cc.

References plotBeamSpotDB::first, m_values, m_xName, m_yName, and contentValuesCheck::ss.

25  {
26  std::stringstream ss;
27  ss<<" { [ ";
28  bool first = true;
29  for( auto iv : m_values ){
30  if(!first) ss << ",";
31  ss <<" { ";
32  ss <<" \""<<m_xName<<"\": "<<std::get<0>(iv)<<",";
33  ss <<" \""<<m_yName<<"\": "<<std::get<1>(iv)<<",";
34  ss <<" \""<<m_yName<<"_Error\": "<<std::get<2>(iv);
35  ss <<" } ";
36  first = false;
37  }
38  ss<<"] }";
39  return ss.str();
40  }
std::vector< std::tuple< std::string, std::string, std::string > > m_values
Definition: JsonPrinter.h:27

Member Data Documentation

std::vector<std::tuple<std::string,std::string,std::string> > cond::utilities::JsonPrinter::m_values
private

Definition at line 27 of file JsonPrinter.h.

Referenced by append(), and print().

std::string cond::utilities::JsonPrinter::m_xName = "X"
private

Definition at line 25 of file JsonPrinter.h.

Referenced by print().

std::string cond::utilities::JsonPrinter::m_yName = "Y"
private

Definition at line 26 of file JsonPrinter.h.

Referenced by print().