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, EventID const &tag, 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, 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
void toDigest (cms::Digest &digest) const
void toString (std::string &result) const
std::string toString () 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 41 of file Entry.h.


Constructor & Destructor Documentation

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

Definition at line 257 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 266 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 275 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 284 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 293 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 302 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 311 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 320 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 329 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 338 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 347 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 356 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 365 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 374 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 383 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 393 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 403 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 412 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 422 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 432 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 443 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 453 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 462 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 472 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 481 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 490 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 500 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 509 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 518 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 526 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 549 of file Entry.cc.

References edm::errors::Configuration, 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 81 of file Entry.cc.

{}

Member Function Documentation

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

Definition at line 617 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 638 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 742 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 822 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 845 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 911 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 798 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 673 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 868 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 889 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 934 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 697 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 720 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 753 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 834 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 856 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 922 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 810 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 661 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 684 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 879 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 900 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 945 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 775 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 708 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 731 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 170 of file Entry.h.

References rep.

Referenced by toString().

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

Definition at line 1076 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]
void Entry::toDigest ( cms::Digest digest) const

Definition at line 599 of file Entry.cc.

References cms::Digest::append(), rep, and tracked.

                                         {
    digest.append(&tracked, 1);
    digest.append(&type, 1);
    digest.append("(", 1);
    digest.append(rep);
    digest.append(")", 1);
  }
void Entry::toString ( std::string &  result) const

Definition at line 589 of file Entry.cc.

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

                                         {
    result.reserve(result.size() + sizeOfString());
    result += tracked;
    result += type;
    result += '(';
    result += rep;
    result += ')';
  }
std::string Entry::toString ( ) const

Definition at line 608 of file Entry.cc.

References query::result.

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

                        {
    std::string result;
    toString(result);
    return result;
  }
char edm::Entry::typeCode ( ) const [inline]
void Entry::validate ( ) const [private]

Definition at line 88 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 954 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 180 of file Entry.h.

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

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

Definition at line 183 of file Entry.h.

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

char edm::Entry::type [private]

Definition at line 182 of file Entry.h.

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