CMS 3D CMS Logo

Functions
edm::pdtentry Namespace Reference

Functions

PdtEntry getPdtEntry (Entry const &e, char const *name)
 
std::vector< PdtEntrygetPdtEntryVector (Entry const &e, char const *name)
 

Function Documentation

PdtEntry edm::pdtentry::getPdtEntry ( Entry const &  e,
char const *  name 
)

Definition at line 49 of file PdtEntry.cc.

References edm::errors::Configuration, Exception, edm::Entry::getInt32(), edm::Entry::getString(), PdtEntry::PdtEntry(), and edm::Entry::typeCode().

Referenced by edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

49  {
50  if (e.typeCode() == 'I')
51  return PdtEntry(e.getInt32());
52  else if (e.typeCode() == 'S')
53  return PdtEntry(e.getString());
54  else
55  throw Exception(errors::Configuration, "EntryError")
56  << "can not convert representation of " << name << " to value of type PdtEntry. "
57  << "Please, provide a parameter either of type int32 or string.";
58  }
std::vector< PdtEntry > edm::pdtentry::getPdtEntryVector ( Entry const &  e,
char const *  name 
)

Definition at line 60 of file PdtEntry.cc.

References edm::errors::Configuration, Exception, edm::Entry::getVInt32(), edm::Entry::getVString(), mps_fire::i, runTheMatrix::ret, edm::Entry::typeCode(), and findQualityFiles::v.

Referenced by edm::ParameterSet::getParameter< std::vector< PdtEntry > >(), and edm::ParameterSet::getUntrackedParameter< std::vector< PdtEntry > >().

60  {
61  std::vector<PdtEntry> ret;
62  if (e.typeCode() == 'i') {
63  std::vector<int> v(e.getVInt32());
64  for (std::vector<int>::const_iterator i = v.begin(); i != v.end(); ++i)
65  ret.push_back(PdtEntry(*i));
66  return ret;
67  } else if (e.typeCode() == 's') {
68  std::vector<std::string> v(e.getVString());
69  for (std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i)
70  ret.push_back(PdtEntry(*i));
71  return ret;
72  } else
73  throw Exception(errors::Configuration, "EntryError")
74  << "can not convert representation of " << name << " to value of type PdtEntry. "
75  << "Please, provide a parameter either of type int32 or string.";
76  }
ret
prodAgent to be discontinued