CMS 3D CMS Logo

Functions | Variables
cond::impl Namespace Reference

Functions

template<typename T >
T from_string (const std::string &attributeValue)
 
template<>
std::string from_string (const std::string &attributeValue)
 
template<>
float from_string (const std::string &attributeValue)
 
template<>
int from_string (const std::string &attributeValue)
 
template<>
unsigned short from_string (const std::string &attributeValue)
 
template<>
LHCInfo::FillType from_string (const std::string &attributeValue)
 
template<>
unsigned long long from_string (const std::string &attributeValue)
 
template<>
LHCInfo::ParticleType from_string (const std::string &attributeValue)
 
template<>
LHCInfoPerFill::FillType from_string (const std::string &attributeValue)
 
template<>
LHCInfoPerFill::ParticleType from_string (const std::string &attributeValue)
 
template<>
boost::posix_time::ptime from_string (const std::string &attributeValue)
 
template<typename T , T fun>
T from_string_impl (const std::string &attributeValue, T zero)
 
float s_to_f (const std::string &val)
 
int s_to_i (const std::string &val)
 
boost::posix_time::ptime s_to_time (const std::string &val)
 
unsigned long s_to_ul (const std::string &val)
 
unsigned long long s_to_ull (const std::string &val)
 
template<typename V >
std::string to_string (const V &value)
 
template<typename V >
std::string to_string (const V *value)
 
template<>
std::string to_string (const std::string &value)
 
template<>
std::string to_string (const char *value)
 
template<>
std::string to_string (const boost::posix_time::ptime &value)
 

Variables

static constexpr const char *const OMS_TIME_FMT = "%Y-%m-%dT%H:%M:%SZ"
 

Function Documentation

◆ from_string() [1/11]

template<typename T >
T cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 28 of file OMSAccess.h.

28  {
29  throw std::invalid_argument("");
30  }

◆ from_string() [2/11]

template<>
std::string cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 33 of file OMSAccess.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

33  {
34  return std::string(attributeValue);
35  }

◆ from_string() [3/11]

template<>
float cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 39 of file OMSAccess.h.

39  {
40  return from_string_impl<float, &s_to_f>(attributeValue, 0.);
41  }

◆ from_string() [4/11]

template<>
int cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 45 of file OMSAccess.h.

45  {
46  return from_string_impl<int, &s_to_i>(attributeValue, 0);
47  }

◆ from_string() [5/11]

template<>
unsigned short cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 51 of file OMSAccess.h.

51  {
52  unsigned long int_val = from_string_impl<unsigned long, &s_to_ul>(attributeValue, 0);
53  return (unsigned short)int_val;
54  }

◆ from_string() [6/11]

template<>
LHCInfo::FillType cond::impl::from_string ( const std::string &  attributeValue)

Definition at line 53 of file LHCInfoPopConSourceHandler.cc.

References LHCInfo::UNKNOWN.

53  {
54  return from_string_impl<LHCInfo::FillType, &fillTypeFromString>(attributeValue, LHCInfo::UNKNOWN);
55  }

◆ from_string() [7/11]

template<>
unsigned long long cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 57 of file OMSAccess.h.

57  {
58  unsigned long long int_val = from_string_impl<unsigned long long, &s_to_ull>(attributeValue, 0);
59  return int_val;
60  }

◆ from_string() [8/11]

template<>
LHCInfo::ParticleType cond::impl::from_string ( const std::string &  attributeValue)

Definition at line 58 of file LHCInfoPopConSourceHandler.cc.

References LHCInfo::NONE.

58  {
59  return from_string_impl<LHCInfo::ParticleType, &particleTypeFromString>(attributeValue, LHCInfo::NONE);
60  }

◆ from_string() [9/11]

template<>
LHCInfoPerFill::FillType cond::impl::from_string ( const std::string &  attributeValue)

Definition at line 62 of file LHCInfoPerFillPopConAnalyzer.cc.

References LHCInfoPerFill::UNKNOWN.

62  {
63  return from_string_impl<LHCInfoPerFill::FillType, &theLHCInfoPerFillPopConImpl::fillTypeFromString>(
64  attributeValue, LHCInfoPerFill::UNKNOWN);
65  }

◆ from_string() [10/11]

template<>
LHCInfoPerFill::ParticleType cond::impl::from_string ( const std::string &  attributeValue)

Definition at line 68 of file LHCInfoPerFillPopConAnalyzer.cc.

References LHCInfoPerFill::NONE.

68  {
69  return from_string_impl<LHCInfoPerFill::ParticleType, &theLHCInfoPerFillPopConImpl::particleTypeFromString>(
70  attributeValue, LHCInfoPerFill::NONE);
71  }

◆ from_string() [11/11]

template<>
boost::posix_time::ptime cond::impl::from_string ( const std::string &  attributeValue)
inline

Definition at line 72 of file OMSAccess.h.

72  {
73  return from_string_impl<boost::posix_time::ptime, &s_to_time>(attributeValue, boost::posix_time::ptime());
74  }

◆ from_string_impl()

template<typename T , T fun>
T cond::impl::from_string_impl ( const std::string &  attributeValue,
T  zero 
)
inline

Definition at line 19 of file OMSAccess.h.

References runTheMatrix::ret, and SiPixelPI::zero.

19  {
20  T ret = zero;
21  if (not attributeValue.empty() && attributeValue != "null") {
22  ret = fun(attributeValue);
23  }
24  return ret;
25  }
ret
prodAgent to be discontinued
long double T

◆ s_to_f()

float cond::impl::s_to_f ( const std::string &  val)
inline

Definition at line 37 of file OMSAccess.h.

References heppy_batch::val.

37 { return std::stof(val); }

◆ s_to_i()

int cond::impl::s_to_i ( const std::string &  val)
inline

Definition at line 43 of file OMSAccess.h.

References heppy_batch::val.

43 { return std::stoi(val); }

◆ s_to_time()

boost::posix_time::ptime cond::impl::s_to_time ( const std::string &  val)
inline

Definition at line 62 of file OMSAccess.h.

References OMS_TIME_FMT, contentValuesCheck::ss, hcalRecHitTable_cff::time, and heppy_batch::val.

62  {
63  boost::posix_time::time_input_facet* facet = new boost::posix_time::time_input_facet(OMS_TIME_FMT);
64  std::stringstream ss;
65  ss.imbue(std::locale(std::locale(), facet));
66  ss << val;
67  boost::posix_time::ptime time;
68  ss >> time;
69  return time;
70  }
static constexpr const char *const OMS_TIME_FMT
Definition: OMSAccess.h:16

◆ s_to_ul()

unsigned long cond::impl::s_to_ul ( const std::string &  val)
inline

Definition at line 49 of file OMSAccess.h.

References heppy_batch::val.

49 { return std::stoul(val); }

◆ s_to_ull()

unsigned long long cond::impl::s_to_ull ( const std::string &  val)
inline

Definition at line 55 of file OMSAccess.h.

References heppy_batch::val.

55 { return std::stoull(val); }

◆ to_string() [1/5]

template<typename V >
std::string cond::impl::to_string ( const V &  value)
inline

Definition at line 77 of file OMSAccess.h.

References to_string().

Referenced by cond::OMSServiceQuery::filter().

77  {
78  return std::to_string(value);
79  }
static std::string to_string(const XMLCh *ch)
Definition: value.py:1

◆ to_string() [2/5]

template<typename V >
std::string cond::impl::to_string ( const V *  value)
inline

Definition at line 81 of file OMSAccess.h.

References to_string().

81  {
82  return std::to_string(*value);
83  }
static std::string to_string(const XMLCh *ch)
Definition: value.py:1

◆ to_string() [3/5]

template<>
std::string cond::impl::to_string ( const std::string &  value)
inline

Definition at line 85 of file OMSAccess.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ to_string() [4/5]

template<>
std::string cond::impl::to_string ( const char *  value)
inline

Definition at line 89 of file OMSAccess.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ to_string() [5/5]

template<>
std::string cond::impl::to_string ( const boost::posix_time::ptime &  value)
inline

Definition at line 93 of file OMSAccess.h.

References OMS_TIME_FMT, cms::cuda::stream, and relativeConstraints::value.

93  {
94  boost::posix_time::time_facet* facet = new boost::posix_time::time_facet();
95  facet->format(OMS_TIME_FMT);
96  std::stringstream stream;
97  stream.imbue(std::locale(std::locale::classic(), facet));
98  stream << value;
99  return stream.str();
100  }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
static constexpr const char *const OMS_TIME_FMT
Definition: OMSAccess.h:16

Variable Documentation

◆ OMS_TIME_FMT

constexpr const char* const cond::impl::OMS_TIME_FMT = "%Y-%m-%dT%H:%M:%SZ"
static

Definition at line 16 of file OMSAccess.h.

Referenced by s_to_time(), and to_string().