CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

edm::VParameterSetEntry Class Reference

#include <VParameterSetEntry.h>

List of all members.

Public Member Functions

bool isTracked () const
ParameterSetpsetInVector (int i)
void registerPsetsAndUpdateIDs ()
std::vector< ParameterSet >
::size_type 
size () const
void toDigest (cms::Digest &digest) const
std::string toString () const
void toString (std::string &result) const
 VParameterSetEntry (std::vector< ParameterSet > const &vpset, bool isTracked)
 VParameterSetEntry ()
 VParameterSetEntry (std::string const &rep)
std::vector< ParameterSet > const & vpset () const
std::vector< ParameterSet > & vpset ()
 ~VParameterSetEntry ()

Private Attributes

value_ptr< std::vector
< ParameterSetID > > 
theIDs
value_ptr< std::vector
< ParameterSet > > 
theVPSet
bool tracked

Friends

std::ostream & operator<< (std::ostream &os, VParameterSetEntry const &vpsetEntry)

Detailed Description

Definition at line 22 of file VParameterSetEntry.h.


Constructor & Destructor Documentation

edm::VParameterSetEntry::VParameterSetEntry ( )

Definition at line 11 of file VParameterSetEntry.cc.

                                         :
      tracked(false),
      theVPSet(),
      theIDs() {
  }
edm::VParameterSetEntry::VParameterSetEntry ( std::vector< ParameterSet > const &  vpset,
bool  isTracked 
)

Definition at line 17 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, and theVPSet.

                                                                                             :
      tracked(isTracked),
      theVPSet(new std::vector<ParameterSet>),
      theIDs() {
    for (std::vector<ParameterSet>::const_iterator i = vpset.begin(), e = vpset.end(); i != e; ++i) {
      theVPSet->push_back(*i);
    }
  }
edm::VParameterSetEntry::VParameterSetEntry ( std::string const &  rep)

Definition at line 26 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, edm::split(), groupFilesInBlocks::temp, and theIDs.

                                                             :
      tracked(rep[0] == '+'),
      theVPSet(),
      theIDs(new std::vector<ParameterSetID>) {
    assert(rep[0] == '+' || rep[0] == '-');
    std::vector<std::string> temp;
    // need a substring that starts at the '{'
    std::string bracketedRepr(rep.begin()+2, rep.end());
    split(std::back_inserter(temp), bracketedRepr, '{', ',', '}');
    theIDs->reserve(temp.size());
    for (std::vector<std::string>::const_iterator i = temp.begin(), e = temp.end(); i != e; ++i) {
      theIDs->push_back(ParameterSetID(*i));
    }
  }
edm::VParameterSetEntry::~VParameterSetEntry ( )

Definition at line 41 of file VParameterSetEntry.cc.

{}

Member Function Documentation

bool edm::VParameterSetEntry::isTracked ( ) const [inline]

Definition at line 35 of file VParameterSetEntry.h.

References tracked.

Referenced by FWPSetTableManager::handleVPSetEntry(), edm::operator<<(), and prettyPrint().

{return tracked;}
ParameterSet & edm::VParameterSetEntry::psetInVector ( int  i)
void edm::VParameterSetEntry::registerPsetsAndUpdateIDs ( )

Definition at line 107 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, theIDs, theVPSet, and vpset().

                                                     {
    vpset();
    theIDs = value_ptr<std::vector<ParameterSetID> >(new std::vector<ParameterSetID>);
    theIDs->resize(theVPSet->size());
    for (std::vector<ParameterSet>::iterator i = theVPSet->begin(), e = theVPSet->end(); i != e; ++i) {
      if (!i->isRegistered()) {
        i->registerIt();
      }
      theIDs->at(i - theVPSet->begin()) = i->id();
    }
  }
std::vector<ParameterSet>::size_type edm::VParameterSetEntry::size ( void  ) const [inline]
void edm::VParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 59 of file VParameterSetEntry.cc.

References cms::Digest::append(), alignCSCRings::e, i, theIDs, and tracked.

                                                      {
    assert(theIDs);
    digest.append(tracked ? "+q{" : "-q{", 3);
    bool started = false;
    for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
      if (started)
        digest.append(",", 1);
      i->toDigest(digest);
      started = true;
    }
    digest.append("}",1);
  }
std::string edm::VParameterSetEntry::toString ( ) const

Definition at line 72 of file VParameterSetEntry.cc.

References query::result.

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

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

Definition at line 44 of file VParameterSetEntry.cc.

References alignCSCRings::e, i, dqm_diff::start, theIDs, and tracked.

                                                      {
    assert(theIDs);
    result += tracked ? "+q" : "-q";
    result += '{';
    std::string start;
    std::string const between(",");
    for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
      result += start;
      i->toString(result);
      start = between;
    }
    result += '}';
  }
std::vector< ParameterSet > & edm::VParameterSetEntry::vpset ( )

Definition at line 90 of file VParameterSetEntry.cc.

References alignCSCRings::e, edm::getParameterSet(), i, theIDs, and theVPSet.

                                                     {
    if (!theVPSet) {
      assert(theIDs);
      theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
      theVPSet->reserve(theIDs->size());
      for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
        theVPSet->push_back(getParameterSet(*i));
      }
    }
    return *theVPSet;
  }
std::vector< ParameterSet > const & edm::VParameterSetEntry::vpset ( ) const

returns the VPSet, reconstituting it from the Registry, if necessary

Definition at line 78 of file VParameterSetEntry.cc.

References alignCSCRings::e, edm::getParameterSet(), i, theIDs, and theVPSet.

Referenced by edm::ParameterSet::getParameterSetVector(), edm::ParameterSet::getUntrackedParameterSetVector(), FWPSetTableManager::handleVPSetEntry(), edm::operator<<(), prettyPrint(), registerPsetsAndUpdateIDs(), and size().

                                                                 {
    if (!theVPSet) {
      assert(theIDs);
      theVPSet = value_ptr<std::vector<ParameterSet> >(new std::vector<ParameterSet>);
      theVPSet->reserve(theIDs->size());
      for (std::vector<ParameterSetID>::const_iterator i = theIDs->begin(), e = theIDs->end(); i != e; ++i) {
        theVPSet->push_back(getParameterSet(*i));
      }
    }
    return *theVPSet;
  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
VParameterSetEntry const &  vpsetEntry 
) [friend]

Definition at line 119 of file VParameterSetEntry.cc.

                                                                               {
    std::vector<ParameterSet> const& vps = vpsetEntry.vpset();
    os << "VPSet "<<(vpsetEntry.isTracked()?"tracked":"untracked")<<" = ({" << std::endl;
    std::string start;
    std::string const between(",\n");
    for(std::vector<ParameterSet>::const_iterator i = vps.begin(), e = vps.end(); i != e; ++i) {
      os << start << *i;
      start = between;
    }
    if (!vps.empty()) {
      os << std::endl;
    }
    os << "})";
    return os;
  }

Member Data Documentation

value_ptr<std::vector<ParameterSetID> > edm::VParameterSetEntry::theIDs [mutable, private]
value_ptr<std::vector<ParameterSet> > edm::VParameterSetEntry::theVPSet [mutable, private]

Definition at line 51 of file VParameterSetEntry.h.

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