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 ()
 ParameterSetEntry (std::string const &rep)
 ParameterSetEntry (ParameterSet const &pset, bool isTracked)
 ParameterSetEntry (ParameterSetID const &id, bool isTracked)
ParameterSetpset ()
ParameterSet const & pset () const
void toString (std::string &result) const
std::string toString () 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 18 of file ParameterSetEntry.h.


Constructor & Destructor Documentation

edm::ParameterSetEntry::ParameterSetEntry ( )

Definition at line 9 of file ParameterSetEntry.cc.

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

Definition at line 16 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 26 of file ParameterSetEntry.cc.

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

Definition at line 33 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 45 of file ParameterSetEntry.cc.

{}

Member Function Documentation

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

Definition at line 34 of file ParameterSetEntry.h.

References theID_.

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

Definition at line 32 of file ParameterSetEntry.h.

References isTracked_.

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

{return isTracked_;}
ParameterSet const & edm::ParameterSetEntry::pset ( ) const

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

Definition at line 67 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_;
  }
ParameterSet & edm::ParameterSetEntry::pset ( )

Definition at line 75 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_;
  }
void edm::ParameterSetEntry::toString ( std::string &  result) const

Definition at line 48 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 61 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 83 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 88 of file ParameterSetEntry.cc.

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

Member Data Documentation

Definition at line 47 of file ParameterSetEntry.h.

Referenced by isTracked().

Definition at line 53 of file ParameterSetEntry.h.

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

Definition at line 50 of file ParameterSetEntry.h.

Referenced by pset().