CMS 3D CMS Logo

Public Member Functions | Private Attributes | Friends

edm::ParameterSetEntry Class Reference

#include <ParameterSetEntry.h>

List of all members.

Public Member Functions

ParameterSetID id () const
bool isTracked () const
 ParameterSetEntry (ParameterSet const &pset, bool isTracked)
 ParameterSetEntry (std::string const &rep)
 ParameterSetEntry ()
 ParameterSetEntry (ParameterSetID const &id, bool isTracked)
ParameterSet const & pset () const
ParameterSetpset ()
void toDigest (cms::Digest &digest) const
std::string toString () const
void toString (std::string &result) const
void updateID () const
 ~ParameterSetEntry ()

Private Attributes

bool isTracked_
ParameterSetID theID_
value_ptr< ParameterSetthePSet_

Friends

std::ostream & operator<< (std::ostream &os, ParameterSetEntry const &psetEntry)

Detailed Description

Definition at line 21 of file ParameterSetEntry.h.


Constructor & Destructor Documentation

edm::ParameterSetEntry::ParameterSetEntry ( )

Definition at line 11 of file ParameterSetEntry.cc.

  : isTracked_(false),
    thePSet_(0),
    theID_()
  {
  }
edm::ParameterSetEntry::ParameterSetEntry ( ParameterSet const &  pset,
bool  isTracked 
)

Definition at line 18 of file ParameterSetEntry.cc.

References edm::ParameterSet::id(), edm::ParameterSet::isRegistered(), and theID_.

  : isTracked_(isTracked),
    thePSet_(new ParameterSet(pset)),
    theID_()
  {
    if (pset.isRegistered()) {
      theID_ = pset.id();
    }
  }
edm::ParameterSetEntry::ParameterSetEntry ( ParameterSetID const &  id,
bool  isTracked 
)

Definition at line 28 of file ParameterSetEntry.cc.

edm::ParameterSetEntry::ParameterSetEntry ( std::string const &  rep) [explicit]

Definition at line 35 of file ParameterSetEntry.cc.

References edm::Hash< I >::swap(), and theID_.

  : isTracked_(rep[0] == '+'),
    thePSet_(),
    theID_()
  {
    assert(rep[0] == '+' || rep[0] == '-');
    assert(rep[2] == '(');
    assert(rep[rep.size()-1] == ')');
    ParameterSetID newID(std::string(rep.begin()+3, rep.end()-1) );
    theID_.swap(newID);
  }
edm::ParameterSetEntry::~ParameterSetEntry ( )

Definition at line 47 of file ParameterSetEntry.cc.

{}

Member Function Documentation

ParameterSetID edm::ParameterSetEntry::id ( void  ) const [inline]

Definition at line 38 of file ParameterSetEntry.h.

References theID_.

{return theID_;}
bool edm::ParameterSetEntry::isTracked ( ) const [inline]
ParameterSet & edm::ParameterSetEntry::pset ( )

Definition at line 90 of file ParameterSetEntry.cc.

References edm::getParameterSet(), theID_, and thePSet_.

                                        {
    if(!thePSet_) {
      // get it from the registry, and save it here
      thePSet_ = value_ptr<ParameterSet>(new ParameterSet(getParameterSet(theID_)));
    }
    return *thePSet_;
  }
ParameterSet const & edm::ParameterSetEntry::pset ( ) const

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

Definition at line 82 of file ParameterSetEntry.cc.

References edm::getParameterSet(), theID_, and thePSet_.

Referenced by edm::ParameterSet::getParameterSet(), edm::ParameterSet::getUntrackedParameterSet(), FWPSetTableManager::handlePSetEntry(), edm::operator<<(), prettyPrint(), and updateID().

                                                    {
    if(!thePSet_) {
      // get it from the registry, and save it here
      thePSet_ = value_ptr<ParameterSet>(new ParameterSet(getParameterSet(theID_)));
    }
    return *thePSet_;
  }
void edm::ParameterSetEntry::toDigest ( cms::Digest digest) const

Definition at line 63 of file ParameterSetEntry.cc.

References cms::Digest::append(), Exception, isTracked(), edm::Hash< I >::isValid(), edm::errors::LogicError, theID_, and edm::Hash< I >::toDigest().

                                                     {
    digest.append(isTracked() ? "+Q(" : "-Q(", 3);
    if (!theID_.isValid()) {
      throw edm::Exception(edm::errors::LogicError)
        << "ParameterSet::toString() called prematurely\n"
        << "before ParameterSet::registerIt() has been called\n"
        << "for all nested parameter sets\n";
    }
    theID_.toDigest(digest);
    digest.append(")", 1);
  }
void edm::ParameterSetEntry::toString ( std::string &  result) const

Definition at line 50 of file ParameterSetEntry.cc.

References Exception, isTracked(), edm::Hash< I >::isValid(), edm::errors::LogicError, theID_, and edm::Hash< I >::toString().

                                                     {
    result += isTracked() ? "+Q(" : "-Q(";
    if (!theID_.isValid()) {
      throw edm::Exception(edm::errors::LogicError)
        << "ParameterSet::toString() called prematurely\n"
        << "before ParameterSet::registerIt() has been called\n"
        << "for all nested parameter sets\n";
    }
    theID_.toString(result);
    result += ')';
  }
std::string edm::ParameterSetEntry::toString ( ) const

Definition at line 76 of file ParameterSetEntry.cc.

References query::result.

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

                                    {
    std::string result;
    toString(result);
    return result;
  }
void edm::ParameterSetEntry::updateID ( ) const

Definition at line 98 of file ParameterSetEntry.cc.

References edm::ParameterSet::id(), pset(), and theID_.

                                         {
    assert(pset().isRegistered());
    theID_ = pset().id();
  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
ParameterSetEntry const &  psetEntry 
) [friend]

Definition at line 103 of file ParameterSetEntry.cc.

                                                                               {
     const char* trackiness = (psetEntry.isTracked()?"tracked":"untracked");
    os << "PSet "<<trackiness<<" = ("<< psetEntry.pset() << ")";
    return os;
  }

Member Data Documentation

Definition at line 51 of file ParameterSetEntry.h.

Referenced by isTracked().

Definition at line 57 of file ParameterSetEntry.h.

Referenced by id(), ParameterSetEntry(), pset(), toDigest(), toString(), and updateID().

Definition at line 54 of file ParameterSetEntry.h.

Referenced by pset().