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 54 of file PdtEntry.cc.

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

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

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

Definition at line 66 of file PdtEntry.cc.

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

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

                                                                            {
      std::vector<PdtEntry> ret;
      if (e.typeCode() == 'i') { 
        std::vector<int> v(e.getVInt32());
        for(std::vector<int>::const_iterator i = v.begin(); i != v.end(); ++ i)
          ret.push_back(PdtEntry(*i));
        return ret;
      }
      else if(e.typeCode() == 's') {
        std::vector<std::string> v(e.getVString());
        for(std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i)
          ret.push_back(PdtEntry(*i));
        return ret;
      }
      else 
        throw Exception(errors::Configuration, "EntryError")
        << "can not convert representation of " << name 
        << " to value of type PdtEntry. "
        << "Please, provide a parameter either of type int32 or string.";
    }