CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

edm::Entry Class Reference

#include <Entry.h>

List of all members.

Public Member Functions

 Entry (std::string const &name, bool val, bool is_tracked)
 Entry (std::string const &name, std::vector< int > const &val, bool is_tracked)
 Entry (std::string const &name, std::vector< unsigned > const &val, bool is_tracked)
 Entry (std::string const &name, std::vector< unsigned long long > const &val, bool is_tracked)
 Entry (std::string const &name, ESInputTag const &tag, bool is_tracked)
 Entry (std::string const &name, std::vector< ESInputTag > const &vtag, bool is_tracked)
 Entry (std::string const &name, double val, bool is_tracked)
 Entry (std::string const &name, std::string const &type, std::vector< std::string > const &value, bool is_tracked)
 Entry (std::string const &name, EventID const &tag, bool is_tracked)
 Entry (std::string const &name, std::vector< EventID > const &vtag, bool is_tracked)
 Entry (std::string const &name, long long val, bool is_tracked)
 Entry (std::string const &name, std::vector< double > const &val, bool is_tracked)
 Entry (std::string const &name, LuminosityBlockID const &tag, bool is_tracked)
 Entry (std::string const &name, std::vector< LuminosityBlockID > const &vtag, bool is_tracked)
 Entry (std::string const &name, std::string const &val, bool is_tracked)
 Entry (std::string const &name, LuminosityBlockRange const &tag, bool is_tracked)
 Entry (std::string const &name, std::vector< LuminosityBlockRange > const &vtag, bool is_tracked)
 Entry (std::string const &name, int val, bool is_tracked)
 Entry (std::string const &name, std::vector< long long > const &val, bool is_tracked)
 Entry (std::string const &name, std::vector< std::string > const &val, bool is_tracked)
 Entry (std::string const &name, EventRange const &tag, bool is_tracked)
 Entry (std::string const &name, std::vector< EventRange > const &vtag, bool is_tracked)
 Entry (std::string const &name, FileInPath const &val, bool is_tracked)
 Entry (std::string const &name, ParameterSet const &val, bool is_tracked)
 Entry (std::string const &name, std::vector< ParameterSet > const &val, bool is_tracked)
 Entry (std::string const &name, unsigned val, bool is_tracked)
 Entry (std::string const &name, InputTag const &tag, bool is_tracked)
 Entry (std::string const &name, std::string const &)
 Entry (std::string const &name, std::string const &type, std::string const &value, bool is_tracked)
 Entry (std::string const &name, unsigned long long val, bool is_tracked)
 Entry (std::string const &name, std::vector< InputTag > const &vtag, bool is_tracked)
bool getBool () const
double getDouble () const
ESInputTag getESInputTag () const
EventID getEventID () const
EventRange getEventRange () const
FileInPath getFileInPath () const
InputTag getInputTag () const
int getInt32 () const
long long getInt64 () const
LuminosityBlockID getLuminosityBlockID () const
LuminosityBlockRange getLuminosityBlockRange () const
ParameterSet getPSet () const
std::string getString () const
unsigned getUInt32 () const
unsigned long long getUInt64 () const
std::vector< double > getVDouble () const
std::vector< ESInputTaggetVESInputTag () const
std::vector< EventIDgetVEventID () const
std::vector< EventRangegetVEventRange () const
std::vector< InputTaggetVInputTag () const
std::vector< int > getVInt32 () const
std::vector< long long > getVInt64 () const
std::vector< LuminosityBlockIDgetVLuminosityBlockID () const
std::vector< LuminosityBlockRangegetVLuminosityBlockRange () const
std::vector< ParameterSetgetVPSet () const
std::vector< std::string > getVString () const
std::vector< unsigned > getVUInt32 () const
std::vector< unsigned long long > getVUInt64 () const
bool isTracked () const
size_t sizeOfString () const
std::string toString () const
void toString (std::string &result) const
char typeCode () const
 ~Entry ()

Private Member Functions

bool fromString (std::string::const_iterator b, std::string::const_iterator e)
void throwEncodeError (char const *type) const
void throwEntryError (char const *expectedType, std::string const &badRep) const
void throwValueError (char const *expectedType) const
void validate () const

Private Attributes

std::string name_
std::string rep
char tracked
char type

Friends

std::ostream & operator<< (std::ostream &ost, Entry const &entry)

Detailed Description

Definition at line 37 of file Entry.h.


Constructor & Destructor Documentation

Entry::Entry ( std::string const &  name,
bool  val,
bool  is_tracked 
)

Definition at line 256 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                               :
    name_(name), rep(), type('B'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("bool");
    validate();
  }
Entry::Entry ( std::string const &  name,
int  val,
bool  is_tracked 
)

Definition at line 265 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                               :
    name_(name), rep(), type('I'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("int");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< int > const &  val,
bool  is_tracked 
)

Definition at line 274 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                :
    name_(name), rep(), type('i'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("vector<int>");
    validate();
  }
Entry::Entry ( std::string const &  name,
unsigned  val,
bool  is_tracked 
)

Definition at line 283 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                   :
    name_(name), rep(), type('U'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("unsigned int");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< unsigned > const &  val,
bool  is_tracked 
)

Definition at line 292 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                    :
   name_(name), rep(), type('u'), tracked(is_tracked ? '+' : '-') {
   if(!encode(rep, val)) throwEncodeError("vector<unsigned int>");
    validate();
  }
Entry::Entry ( std::string const &  name,
long long  val,
bool  is_tracked 
)

Definition at line 301 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                    :
    name_(name), rep(), type('L'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("int64");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< long long > const &  val,
bool  is_tracked 
)

Definition at line 310 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                      :
    name_(name), rep(), type('l'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("vector<int64>");
    validate();
  }
Entry::Entry ( std::string const &  name,
unsigned long long  val,
bool  is_tracked 
)

Definition at line 319 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                             :
    name_(name), rep(), type('X'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("unsigned int64");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< unsigned long long > const &  val,
bool  is_tracked 
)

Definition at line 328 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                              :
   name_(name), rep(), type('x'), tracked(is_tracked ? '+' : '-') {
   if(!encode(rep, val)) throwEncodeError("vector<unsigned int64>");
    validate();
  }
Entry::Entry ( std::string const &  name,
double  val,
bool  is_tracked 
)

Definition at line 337 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                :
   name_(name), rep(), type('D'), tracked(is_tracked ? '+' : '-') {
   if(!encode(rep, val)) throwEncodeError("double");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< double > const &  val,
bool  is_tracked 
)

Definition at line 346 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                   :
    name_(name), rep(), type('d'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("vector<double>");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::string const &  val,
bool  is_tracked 
)

Definition at line 355 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                           :
    name_(name), rep(), type('S'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("string");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< std::string > const &  val,
bool  is_tracked 
)

Definition at line 364 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                      :
       name_(name), rep(), type('s'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("vector<string>");
    validate();
  }
Entry::Entry ( std::string const &  name,
FileInPath const &  val,
bool  is_tracked 
)

Definition at line 373 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                            :
    name_(name), rep(), type('F'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("FileInPath");
    validate();
  }
Entry::Entry ( std::string const &  name,
InputTag const &  tag,
bool  is_tracked 
)

Definition at line 382 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                          :
    name_(name), rep(), type('t'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("InputTag");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< InputTag > const &  vtag,
bool  is_tracked 
)

Definition at line 392 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                     :
    name_(name), rep(), type('v'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("VInputTag");
    validate();
  }
Entry::Entry ( std::string const &  name,
ESInputTag const &  tag,
bool  is_tracked 
)

Definition at line 402 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                             :
   name_(name), rep(), type(kTESInputTag), tracked(is_tracked ? '+' : '-') {
      if (!encode(rep, val)) throwEncodeError("InputTag");
      validate();
   }
Entry::Entry ( std::string const &  name,
std::vector< ESInputTag > const &  vtag,
bool  is_tracked 
)

Definition at line 411 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                        :
   name_(name), rep(), type(kTVESInputTag), tracked(is_tracked ? '+' : '-') {
      if (!encode(rep, val)) throwEncodeError("VESInputTag");
      validate();
   }
Entry::Entry ( std::string const &  name,
EventID const &  tag,
bool  is_tracked 
)

Definition at line 421 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                         :
    name_(name), rep(), type('E'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("EventID");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< EventID > const &  vtag,
bool  is_tracked 
)

Definition at line 431 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                    :
    name_(name), rep(), type('e'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("VEventID");
    validate();
  }
Entry::Entry ( std::string const &  name,
LuminosityBlockID const &  tag,
bool  is_tracked 
)

Definition at line 442 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                   :
    name_(name), rep(), type('M'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("LuminosityBlockID");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< LuminosityBlockID > const &  vtag,
bool  is_tracked 
)

Definition at line 452 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                              :
    name_(name), rep(), type('m'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("VLuminosityBlockID");
    validate();
  }
Entry::Entry ( std::string const &  name,
LuminosityBlockRange const &  tag,
bool  is_tracked 
)

Definition at line 461 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                      :
    name_(name), rep(), type('A'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("LuminosityBlockRange");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< LuminosityBlockRange > const &  vtag,
bool  is_tracked 
)

Definition at line 471 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                                 :
    name_(name), rep(), type('a'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("VLuminosityBlockRange");
    validate();
  }
Entry::Entry ( std::string const &  name,
EventRange const &  tag,
bool  is_tracked 
)

Definition at line 480 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                            :
    name_(name), rep(), type('R'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("EventRange");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< EventRange > const &  vtag,
bool  is_tracked 
)

Definition at line 489 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                       :
    name_(name), rep(), type('r'), tracked(is_tracked ? '+' : '-') {
    if (!encode(rep, val)) throwEncodeError("VEventRange");
    validate();
  }
Entry::Entry ( std::string const &  name,
ParameterSet const &  val,
bool  is_tracked 
)

Definition at line 499 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                              :
    name_(name), rep(), type('P'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("ParameterSet");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::vector< ParameterSet > const &  val,
bool  is_tracked 
)

Definition at line 508 of file Entry.cc.

References edm::encode(), rep, throwEncodeError(), and validate().

                                                                                         :
      name_(name), rep(), type('p'), tracked(is_tracked ? '+' : '-') {
    if(!encode(rep, val)) throwEncodeError("vector<ParameterSet>");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::string const &  code 
)

Definition at line 517 of file Entry.cc.

References fromString(), throwEncodeError(), and validate().

                                                           :
    name_(name), rep(), type('?'), tracked('?') {
    if(!fromString(code.begin(), code.end()))
      throwEncodeError("coded string");
    validate();
  }
Entry::Entry ( std::string const &  name,
std::string const &  type,
std::string const &  value,
bool  is_tracked 
)

Definition at line 525 of file Entry.cc.

References edm::errors::Configuration, Exception, fromString(), edm::sTypeTranslations, type, edm::pset::TypeTrans::type2Code_, validate(), and relativeConstraints::value.

                                :
    name_(name), rep(), type('?'), tracked('?') {
    std::string codedString(is_tracked ?"-":"+");

    Type2Code::const_iterator itFound = sTypeTranslations.type2Code_.find(type);
    if(itFound == sTypeTranslations.type2Code_.end()) {
        throw Exception(errors::Configuration)
          << "bad type name used for Entry : " << type;
    }

    codedString += itFound->second;
    codedString +='(';
    codedString += value;
    codedString +=')';

    if(!fromString(codedString.begin(), codedString.end())) {
        throw Exception(errors::Configuration)
          <<  "bad encoded Entry string " <<  codedString;
    }
    validate();
  }
Entry::Entry ( std::string const &  name,
std::string const &  type,
std::vector< std::string > const &  value,
bool  is_tracked 
)

Definition at line 548 of file Entry.cc.

References edm::errors::Configuration, ExpressReco_HICollisions_FallBack::e, Exception, fromString(), i, edm::sTypeTranslations, type, edm::pset::TypeTrans::type2Code_, and validate().

                                :
    name_(name), rep() , type('?'), tracked('?') {
    std::string codedString(is_tracked ?"-":"+");

    Type2Code::const_iterator itFound =
      sTypeTranslations.type2Code_.find(type);
    if(itFound == sTypeTranslations.type2Code_.end()) {
        throw Exception(errors::Configuration)
          << "bad type name used for Entry : " << type;
    }

    codedString += itFound->second;
    codedString += '(';
    codedString += '{';
    std::vector<std::string>::const_iterator i = value.begin();
    std::vector<std::string>::const_iterator e = value.end();
    std::string const kSeparator(",");
    std::string sep("");
    for(; i!= e; ++i) {
      codedString += sep;
      codedString += *i;
      sep = kSeparator;
    }
    codedString += '}';
    codedString += ')';

    if(!fromString(codedString.begin(), codedString.end())) {
        throw Exception(errors::Configuration)
          << "bad encoded Entry string " << codedString;
    }
    validate();
  }
Entry::~Entry ( )

Definition at line 80 of file Entry.cc.

{}

Member Function Documentation

bool Entry::fromString ( std::string::const_iterator  b,
std::string::const_iterator  e 
) [private]

Definition at line 607 of file Entry.cc.

References rep, and tracked.

Referenced by Entry().

                                                                                    {
    if(static_cast<unsigned int>(e - b) < 4u || b[2] != '(' || e[-1] != ')')

      return false;

    tracked = b[0];
    type = b[1];
    rep = std::string(b+3, e-1);

    return true;
  }  // from_string()
bool Entry::getBool ( ) const

Definition at line 628 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                       {
    if (type != 'B') throwValueError("bool");
    bool  val;
    if (!decode(val, rep)) throwEntryError("bool", rep);
    return val;
  }
double Entry::getDouble ( ) const

Definition at line 732 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                         {
    if(type != 'D') throwValueError("double");
    double  val;
    if(!decode(val, rep)) throwEntryError("double", rep);
    return val;
  }
ESInputTag Entry::getESInputTag ( ) const

Definition at line 812 of file Entry.cc.

References edm::decode(), kTESInputTag, rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                              {
      if(type != kTESInputTag) throwValueError("ESInputTag");
      ESInputTag val;
      if(!decode(val, rep)) throwEntryError("ESInputTag", rep);
      return val;
   }
EventID Entry::getEventID ( ) const

Definition at line 835 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                          {
    if(type != 'E') throwValueError("EventID");
    EventID val;
    if(!decode(val, rep)) throwEntryError("EventID", rep);
    return val;
  }
EventRange Entry::getEventRange ( ) const

Definition at line 901 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                             {
    if(type != 'R') throwValueError("EventRange");
    EventRange val;
    if(!decode(val, rep)) throwEntryError("EventRange", rep);
    return val;
  }
FileInPath Entry::getFileInPath ( ) const
InputTag Entry::getInputTag ( ) const

Definition at line 788 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

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

                           {
    if(type != 't') throwValueError("InputTag");
    InputTag val;
    if(!decode(val, rep)) throwEntryError("InputTag", rep);
    return val;
  }
int Entry::getInt32 ( ) const
long long Entry::getInt64 ( ) const

Definition at line 663 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter().

                        {
    if(type != 'L') throwValueError("int64");
    long long  val;
    if(!decode(val, rep)) throwEntryError("int64", rep);
    return val;
  }
LuminosityBlockID Entry::getLuminosityBlockID ( ) const

Definition at line 858 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                                    {
    if(type != 'M') throwValueError("LuminosityBlockID");
    LuminosityBlockID val;
    if(!decode(val, rep)) throwEntryError("LuminosityBlockID", rep);
    return val;
  }
LuminosityBlockRange Entry::getLuminosityBlockRange ( ) const

Definition at line 879 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                                       {
    if(type != 'A') throwValueError("LuminosityBlockRange");
    LuminosityBlockRange val;
    if(!decode(val, rep)) throwEntryError("LuminosityBlockRange", rep);
    return val;
  }
ParameterSet Entry::getPSet ( ) const

Definition at line 924 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::fromString(), FWPSetTableManager::handleEntry(), and edm::operator<<().

                       {
    if(type != 'P') throwValueError("ParameterSet");
    ParameterSet val;
    if(!decode(val, rep)) throwEntryError("ParameterSet", rep);
    return val;
  }
std::string Entry::getString ( void  ) const
unsigned Entry::getUInt32 ( ) const

Definition at line 687 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), FWPSetTableManager::handleEntry(), and edm::operator<<().

                         {
    if(type != 'U') throwValueError("unsigned int");
    unsigned  val;
    if(!decode(val, rep)) throwEntryError("unsigned int", rep);
    return val;
  }
unsigned long long Entry::getUInt64 ( ) const

Definition at line 710 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                         {
    if(type != 'X') throwValueError("uint64");
    unsigned long long val;
    if(!decode(val, rep)) throwEntryError("uint64", rep);
    return val;
  }
std::vector< double > Entry::getVDouble ( ) const

Definition at line 743 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                          {
    if(type != 'd') throwValueError("vector<double>");
    std::vector<double>  val;
    if(!decode(val, rep)) throwEntryError("vector<double>", rep);
    return val;
  }
std::vector< ESInputTag > Entry::getVESInputTag ( ) const

Definition at line 824 of file Entry.cc.

References edm::decode(), kTVESInputTag, rep, throwEntryError(), and throwValueError().

Referenced by FWPSetTableManager::handleEntry(), edm::operator<<(), and edm::ParameterSet::getUntrackedParameter< std::vector< ESInputTag > >().

                               {
      if(type != kTVESInputTag) throwValueError("VESInputTag");
      std::vector<ESInputTag> val;
      if(!decode(val, rep)) throwEntryError("VESInputTag", rep);
      return val;
   }
std::vector< EventID > Entry::getVEventID ( ) const

Definition at line 846 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                           {
    if(type != 'e') throwValueError("VEventID");
    std::vector<EventID> val;
    if(!decode(val, rep)) throwEntryError("EventID", rep);
    return val;
  }
std::vector< EventRange > Entry::getVEventRange ( ) const

Definition at line 912 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                              {
    if(type != 'r') throwValueError("VEventRange");
    std::vector<EventRange> val;
    if(!decode(val, rep)) throwEntryError("EventRange", rep);
    return val;
  }
std::vector< InputTag > Entry::getVInputTag ( ) const

Definition at line 800 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), FWPSetTableManager::handleEntry(), and edm::operator<<().

                            {
    if(type != 'v') throwValueError("VInputTag");
    std::vector<InputTag> val;
    if(!decode(val, rep)) throwEntryError("VInputTag", rep);
    return val;
  }
std::vector< int > Entry::getVInt32 ( ) const

Definition at line 651 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::pdtentry::getPdtEntryVector(), edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                         {
    if(type != 'i') throwValueError("vector<int>");
    std::vector<int>  val;
    if(!decode(val, rep)) throwEntryError("vector<int>", rep);
    return val;
  }
std::vector< long long > Entry::getVInt64 ( ) const

Definition at line 674 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                         {
    if(type != 'l') throwValueError("vector<int64>");
    std::vector<long long>  val;
    if(!decode(val, rep)) throwEntryError("vector<int64>", rep);
    return val;
  }
std::vector< LuminosityBlockID > Entry::getVLuminosityBlockID ( ) const

Definition at line 869 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                                     {
    if(type != 'm') throwValueError("VLuminosityBlockID");
    std::vector<LuminosityBlockID> val;
    if(!decode(val, rep)) throwEntryError("LuminosityBlockID", rep);
    return val;
  }
std::vector< LuminosityBlockRange > Entry::getVLuminosityBlockRange ( ) const

Definition at line 890 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                                        {
    if(type != 'a') throwValueError("VLuminosityBlockRange");
    std::vector<LuminosityBlockRange> val;
    if(!decode(val, rep)) throwEntryError("LuminosityBlockRange", rep);
    return val;
  }
std::vector< ParameterSet > Entry::getVPSet ( ) const

Definition at line 935 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::fromString(), FWPSetTableManager::handleEntry(), and edm::operator<<().

                        {
    if(type != 'p') throwValueError("vector<ParameterSet>");
    std::vector<ParameterSet>  val;
    if(!decode(val, rep)) throwEntryError("vector<ParameterSet>", rep);
    return val;
  }
std::vector< std::string > Entry::getVString ( ) const

Definition at line 765 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::pdtentry::getPdtEntryVector(), edm::ParameterSet::getUntrackedParameter(), FWPSetTableManager::handleEntry(), and edm::operator<<().

                          {
    if(type != 's') throwValueError("vector<string>");
    std::vector<std::string>  val;
    if(!decode(val, rep)) throwEntryError("vector<string>", rep);
    return val;
  }
std::vector< unsigned > Entry::getVUInt32 ( ) const

Definition at line 698 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                          {
    if(type != 'u') throwValueError("vector<unsigned int>");
    std::vector<unsigned>  val;
    if(!decode(val, rep)) throwEntryError("vector<unsigned int>", rep);
    return val;
  }
std::vector< unsigned long long > Entry::getVUInt64 ( ) const

Definition at line 721 of file Entry.cc.

References edm::decode(), rep, throwEntryError(), and throwValueError().

Referenced by edm::ParameterSet::getUntrackedParameter(), and FWPSetTableManager::handleEntry().

                          {
    if(type != 'x') throwValueError("vector<uint64>");
    std::vector<unsigned long long>  val;
    if(!decode(val, rep)) throwEntryError("vector<uint64>", rep);
    return val;
  }
bool edm::Entry::isTracked ( ) const [inline]
size_t edm::Entry::sizeOfString ( ) const [inline]

Definition at line 165 of file Entry.h.

References rep.

Referenced by toString().

{return rep.size() + 4;}
void Entry::throwEncodeError ( char const *  type) const [private]

Definition at line 1066 of file Entry.cc.

References edm::errors::Configuration, Exception, name_, and type.

Referenced by Entry().

                                                       {
      throw Exception(errors::Configuration, "EncodingError")
        << "can not encode " << name_ << " as type: " << type;
    }
void Entry::throwEntryError ( char const *  expectedType,
std::string const &  badRep 
) const [private]
void Entry::throwValueError ( char const *  expectedType) const [private]
std::string Entry::toString ( ) const

Definition at line 598 of file Entry.cc.

References query::result.

Referenced by edm::ParameterSet::getParameterAsString(), and edm::operator==().

                        {
    std::string result;
    toString(result);
    return result;
  }
void Entry::toString ( std::string &  result) const

Definition at line 588 of file Entry.cc.

References rep, sizeOfString(), tracked, and type.

                                         {
    result.reserve(result.size() + sizeOfString());
    result += tracked;
    result += type;
    result += '(';
    result += rep;
    result += ')';
  }
char edm::Entry::typeCode ( ) const [inline]
void Entry::validate ( ) const [private]

Definition at line 87 of file Entry.cc.

References edm::decode(), kTESInputTag, kTVESInputTag, rep, throwEntryError(), and tracked.

Referenced by Entry().

                        {
    // tracked
    assert (tracked == '+' || tracked == '-');
//     if(tracked != '+' && tracked != '-')
//       throw EntryError(std::string("invalid tracked code ") + tracked);

    // type and rep
    switch(type)  {
      case 'B':  {  // Bool
        bool  val;
        if (!decode(val, rep)) throwEntryError("bool", rep);
        break;
      }
      case 'b':  {  // vBool
        std::vector<bool>  val;
        if(!decode(val, rep)) throwEntryError("vector<bool>", rep);
        break;
      }
      case 'I':  {  // Int32
        int  val;
        if(!decode(val, rep)) throwEntryError("int", rep);
        break;
      }
      case 'i':  {  // vInt32
        std::vector<int>  val;
        if(!decode(val, rep)) throwEntryError("vector<int>", rep);
        break;
      }
      case 'U':  {  // Uint32
        unsigned  val;
        if(!decode(val, rep)) throwEntryError("unsigned int", rep);
        break;
      }
      case 'u':  {  // vUint32
        std::vector<unsigned>  val;
        if(!decode(val, rep)) throwEntryError("vector<unsigned int>", rep);
        break;
      }
      case 'L':  {  // Int64
        int  val;
        if(!decode(val, rep)) throwEntryError("int64", rep);
        break;
      }
      case 'l':  {  // vInt64
        std::vector<int>  val;
        if(!decode(val, rep)) throwEntryError("vector<int64>", rep);
        break;
      }
      case 'X':  {  // Uint64
        unsigned  val;
        if(!decode(val, rep)) throwEntryError("unsigned int64", rep);
        break;
      }
      case 'x':  {  // vUint64
        std::vector<unsigned>  val;
        if(!decode(val, rep)) throwEntryError("vector<unsigned int64>", rep);
        break;
      }
      case 'S':  {  // String
        std::string  val;
        if(!decode(val, rep)) throwEntryError("string", rep);
        break;
      }
      case 's':  {  // vString
        std::vector<std::string>  val;
        if(!decode(val, rep)) throwEntryError("vector<string>", rep);
        break;
      }
      case 'F':  {  // FileInPath
        FileInPath val;
        if(!decode(val, rep)) throwEntryError("FileInPath", rep);
        break;
      }
      case 't':  {  // InputTag
        InputTag val;
        if(!decode(val, rep)) throwEntryError("InputTag", rep);
        break;
      }
      case 'v':  {  // VInputTag
        std::vector<InputTag> val;
        if(!decode(val, rep)) throwEntryError("VInputTag", rep);
        break;
      }
      case kTESInputTag: { //ESInputTag
         ESInputTag val;
         if(!decode(val,rep)) throwEntryError("ESInputTag", rep);
         break;
      }
      case kTVESInputTag: { //ESInputTag
         std::vector<ESInputTag> val;
         if(!decode(val,rep)) throwEntryError("VESInputTag", rep);
         break;
      }
      case 'E':  {  // EventID
        EventID val;
        if(!decode(val, rep)) throwEntryError("EventID", rep);
        break;
      }
      case 'e':  {  // VEventID
        std::vector<EventID> val;
        if(!decode(val, rep)) throwEntryError("VEventID", rep);
        break;
      }
      case 'M':  {  // LuminosityBlockID
        LuminosityBlockID val;
        if(!decode(val, rep)) throwEntryError("LuminosityBlockID", rep);
        break;
      }
      case 'm':  {  // VLuminosityBlockID
        std::vector<LuminosityBlockID> val;
        if(!decode(val, rep)) throwEntryError("VLuminosityBlockID", rep);
        break;
      }
      case 'D':  {  // Double
        double  val;
        if(!decode(val, rep)) throwEntryError("double", rep);
        break;
      }
      case 'd':  {  // vDouble
        std::vector<double>  val;
        if(!decode(val, rep)) throwEntryError("vector<double>", rep);
        break;
      }
      case 'P':  {  // ParameterSet
        ParameterSet val;
        if(!decode(val, rep)) throwEntryError("ParameterSet", rep);
        break;
      }
      case 'p':  {  // vParameterSet
        std::vector<ParameterSet>  val;
        if(!decode(val, rep)) throwEntryError("vector<ParameterSet>", rep);
        break;
      }
      case 'A':  {  // LuminosityBlockRange
        LuminosityBlockRange val;
        if(!decode(val, rep)) throwEntryError("LuminosityBlockRange", rep);
        break;
      }
      case 'a':  {  // VLuminosityBlockRange
        std::vector<LuminosityBlockRange> val;
        if(!decode(val, rep)) throwEntryError("VLuminosityBlockRange", rep);
        break;
      }
      case 'R':  {  // EventRange
        EventRange val;
        if(!decode(val, rep)) throwEntryError("EventRange", rep);
        break;
      }
      case 'r':  {  // VEventRange
        std::vector<EventRange> val;
        if(!decode(val, rep)) throwEntryError("VEventRange", rep);
        break;
      }
      default:  {
        // We should never get here.
        assert ("Invalid type code" == 0);
        //throw EntryError(std::string("invalid type code ") + type);
        break;
      }
    }  // switch(type)
  }  // Entry::validate()

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ost,
Entry const &  entry 
) [friend]

Definition at line 944 of file Entry.cc.

                                                  {
    os << sTypeTranslations.table_[entry.typeCode()] << " "
       << (entry.isTracked() ? "tracked " : "untracked ") <<" = ";

    // now handle the difficult cases
    switch(entry.typeCode()) {
      case 'P': // ParameterSet
      {
        os << entry.getPSet();
        break;
      }
      case 'p': // vector<ParameterSet>
      {
        // Make sure we get the representation of each contained
        // ParameterSet including *only* tracked parameters
        std::vector<ParameterSet> whole = entry.getVPSet();
        std::vector<ParameterSet>::const_iterator i = whole.begin();
        std::vector<ParameterSet>::const_iterator e = whole.end();
        std::string start ="";
        std::string const between(",\n");
        os << "{"<<std::endl;
         for (; i != e; ++i) {
           os <<  start<< *i;
           start = between;
         }
         if (whole.size()) {
           os << std::endl;
         }
         os << "}";
         break;
      }
      case 'S':
      {
        os << "'" << entry.getString() << "'";
        break;
      }
      case 's':
      {

        os << "{";
        std::string start ="'";
        std::string const between(",'");
        std::vector<std::string> strings = entry.getVString();
        for(std::vector<std::string>::const_iterator it = strings.begin(), itEnd = strings.end();
            it != itEnd;
            ++it) {
          os << start << *it << "'";
          start = between;
        }
        os << "}";
        break;
      }
      case 'I':
      {
        os << entry.getInt32();
        break;
      }
      case 'U':
      {
        os << entry.getUInt32();
        break;
      }
      case 'v':
      {
        //VInputTag needs to be treated seperately because it is encode like
        // vector<string> rather than using the individual encodings of each InputTag
        os << "{";
        std::string start = "";
        std::string const between(",");
        std::vector<InputTag> tags = entry.getVInputTag();
        for(std::vector<InputTag>::const_iterator it = tags.begin(), itEnd = tags.end();
            it != itEnd;
            ++it) {
          os << start << it->encode();
          start = between;
        }
        os << "}";
        break;
      }
       case kTVESInputTag:
       {
          //VESInputTag needs to be treated seperately because it is encode like
          // vector<string> rather than using the individual encodings of each ESInputTag
          os << "{";
          std::string start = "";
          std::string const between(",");
          std::vector<ESInputTag> tags = entry.getVESInputTag();
          for(std::vector<ESInputTag>::const_iterator it = tags.begin(), itEnd = tags.end();
              it != itEnd;
              ++it) {
             os << start << it->encode();
             start = between;
          }
          os << "}";
          break;
       }
       default:
      {
        os << entry.rep;
        break;
      }
    }

    return os;
  }

Member Data Documentation

std::string edm::Entry::name_ [private]

Definition at line 175 of file Entry.h.

Referenced by throwEncodeError(), throwEntryError(), and throwValueError().

std::string edm::Entry::rep [private]
char edm::Entry::tracked [private]

Definition at line 178 of file Entry.h.

Referenced by fromString(), isTracked(), toString(), and validate().

char edm::Entry::type [private]

Definition at line 177 of file Entry.h.

Referenced by Entry(), throwEncodeError(), throwValueError(), toString(), and typeCode().