#include <DataProxyProvider.h>
Public Types | |
typedef std::vector< std::pair < DataKey, boost::shared_ptr < DataProxy > > > | KeyedProxies |
typedef std::vector < EventSetupRecordKey > | Keys |
typedef std::map < EventSetupRecordKey, KeyedProxies > | RecordProxies |
Public Member Functions | |
DataProxyProvider () | |
const ComponentDescription & | description () const |
bool | isUsingRecord (const EventSetupRecordKey &) const |
const KeyedProxies & | keyedProxies (const EventSetupRecordKey &iRecordKey) const |
virtual void | newInterval (const EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)=0 |
called when a new interval of validity occurs for iRecordType | |
void | resetProxies (const EventSetupRecordKey &iRecordType) |
void | resetProxiesIfTransient (const EventSetupRecordKey &iRecordType) |
void | setAppendToDataLabel (const edm::ParameterSet &) |
void | setDescription (const ComponentDescription &iDescription) |
std::set< EventSetupRecordKey > | usingRecords () const |
virtual | ~DataProxyProvider () |
Static Public Member Functions | |
static void | prevalidate (ConfigurationDescriptions &) |
Protected Member Functions | |
void | eraseAll (const EventSetupRecordKey &iRecordKey) |
deletes all the Proxies in aStream | |
void | invalidateProxies (const EventSetupRecordKey &iRecordKey) |
virtual void | registerProxies (const EventSetupRecordKey &iRecordKey, KeyedProxies &aProxyList)=0 |
template<class T > | |
void | usingRecord () |
void | usingRecordWithKey (const EventSetupRecordKey &) |
Private Member Functions | |
DataProxyProvider (const DataProxyProvider &) | |
const DataProxyProvider & | operator= (const DataProxyProvider &) |
Private Attributes | |
std::string | appendToDataLabel_ |
ComponentDescription | description_ |
RecordProxies | recordProxies_ |
Definition at line 42 of file DataProxyProvider.h.
typedef std::vector<std::pair<DataKey, boost::shared_ptr<DataProxy> > > edm::eventsetup::DataProxyProvider::KeyedProxies |
Definition at line 48 of file DataProxyProvider.h.
typedef std::vector< EventSetupRecordKey> edm::eventsetup::DataProxyProvider::Keys |
Definition at line 46 of file DataProxyProvider.h.
typedef std::map<EventSetupRecordKey, KeyedProxies> edm::eventsetup::DataProxyProvider::RecordProxies |
Definition at line 49 of file DataProxyProvider.h.
DataProxyProvider::DataProxyProvider | ( | ) |
Definition at line 36 of file DataProxyProvider.cc.
: recordProxies_(), description_() { }
DataProxyProvider::~DataProxyProvider | ( | ) | [virtual] |
Definition at line 45 of file DataProxyProvider.cc.
{ }
edm::eventsetup::DataProxyProvider::DataProxyProvider | ( | const DataProxyProvider & | ) | [private] |
const ComponentDescription& edm::eventsetup::DataProxyProvider::description | ( | ) | const [inline] |
Definition at line 61 of file DataProxyProvider.h.
References description_.
Referenced by keyedProxies(), edm::eventsetup::EventSetupRecordProvider::proxyProvider(), and edm::eventsetup::EventSetupRecordProvider::proxyProviderDescriptions().
{ return description_;}
void edm::eventsetup::DataProxyProvider::eraseAll | ( | const EventSetupRecordKey & | iRecordKey | ) | [protected] |
deletes all the Proxies in aStream
void DataProxyProvider::invalidateProxies | ( | const EventSetupRecordKey & | iRecordKey | ) | [protected] |
Definition at line 72 of file DataProxyProvider.cc.
References recordProxies_.
Referenced by FWLiteESSource::newInterval(), edm::ESProxyFactoryProducer::newInterval(), CondDBESSource::newInterval(), and resetProxies().
{ KeyedProxies& proxyList((*(recordProxies_.find(iRecordKey))).second) ; KeyedProxies::iterator finished(proxyList.end()) ; for (KeyedProxies::iterator keyedProxy(proxyList.begin()) ; keyedProxy != finished ; ++keyedProxy) { (*((*keyedProxy).second)).invalidate() ; } }
bool DataProxyProvider::isUsingRecord | ( | const EventSetupRecordKey & | iKey | ) | const |
Definition at line 119 of file DataProxyProvider.cc.
References recordProxies_.
{ return recordProxies_.end() != recordProxies_.find(iKey); }
const DataProxyProvider::KeyedProxies & DataProxyProvider::keyedProxies | ( | const EventSetupRecordKey & | iRecordKey | ) | const |
Definition at line 139 of file DataProxyProvider.cc.
References appendToDataLabel_, description(), recordProxies_, registerProxies(), AlCaHLTBitMon_QueryRunRegistry::string, edm::eventsetup::swap(), and groupFilesInBlocks::temp.
{ RecordProxies::const_iterator itFind = recordProxies_.find(iRecordKey); assert(itFind != recordProxies_.end()); if(itFind->second.empty()) { //delayed registration KeyedProxies& proxies = const_cast<KeyedProxies&>(itFind->second); const_cast<DataProxyProvider*>(this)->registerProxies(iRecordKey, proxies); bool mustChangeLabels = (0 != appendToDataLabel_.size()); for(KeyedProxies::iterator itProxy = proxies.begin(), itProxyEnd = proxies.end(); itProxy != itProxyEnd; ++itProxy) { itProxy->second->setProviderDescription(&description()); if( mustChangeLabels ) { //Using swap is fine since // 1) the data structure is not a map and so we have not sorted on the keys // 2) this is the first time filling this so no outside agency has yet seen // the label and therefore can not be dependent upon its value std::string temp(std::string(itProxy->first.name().value())+appendToDataLabel_); DataKey newKey(itProxy->first.type(),temp.c_str()); swap(itProxy->first,newKey); } } } return itFind->second; }
virtual void edm::eventsetup::DataProxyProvider::newInterval | ( | const EventSetupRecordKey & | iRecordType, |
const ValidityInterval & | iInterval | ||
) | [pure virtual] |
called when a new interval of validity occurs for iRecordType
Implemented in CondDBESSource, edm::ESProxyFactoryProducer, and FWLiteESSource.
const DataProxyProvider& edm::eventsetup::DataProxyProvider::operator= | ( | const DataProxyProvider & | ) | [private] |
void DataProxyProvider::prevalidate | ( | ConfigurationDescriptions & | iDesc | ) | [static] |
Used to add parameters available to all inheriting classes
Definition at line 176 of file DataProxyProvider.cc.
References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::defaultDescription(), edm::ParameterSetDescription::isLabelUnused(), edm::eventsetup::kAppendToDataLabel(), AlCaHLTBitMon_QueryRunRegistry::string, and v.
{ if(iDesc.defaultDescription()) { if (iDesc.defaultDescription()->isLabelUnused(kAppendToDataLabel)) { iDesc.defaultDescription()->add<std::string>(kAppendToDataLabel, std::string("")); } } for(auto& v: iDesc) { if (v.second.isLabelUnused(kAppendToDataLabel)) { v.second.add<std::string>(kAppendToDataLabel, std::string("")); } } }
virtual void edm::eventsetup::DataProxyProvider::registerProxies | ( | const EventSetupRecordKey & | iRecordKey, |
KeyedProxies & | aProxyList | ||
) | [protected, pure virtual] |
Implemented in CondDBESSource, edm::ESProxyFactoryProducer, and FWLiteESSource.
Referenced by keyedProxies().
void DataProxyProvider::resetProxies | ( | const EventSetupRecordKey & | iRecordType | ) |
Definition at line 85 of file DataProxyProvider.cc.
References invalidateProxies().
Referenced by edm::eventsetup::EventSetupRecordProvider::resetProxies().
{ invalidateProxies(iRecordKey); }
void DataProxyProvider::resetProxiesIfTransient | ( | const EventSetupRecordKey & | iRecordType | ) |
Definition at line 91 of file DataProxyProvider.cc.
References recordProxies_.
Referenced by edm::eventsetup::EventSetupRecordProvider::resetProxies(), and edm::eventsetup::EventSetupRecordProvider::resetTransients().
{ KeyedProxies& proxyList((*(recordProxies_.find(iRecordKey))).second) ; KeyedProxies::iterator finished(proxyList.end()) ; for (KeyedProxies::iterator keyedProxy(proxyList.begin()) ; keyedProxy != finished ; ++keyedProxy) { (*((*keyedProxy).second)).resetIfTransient() ; } }
void DataProxyProvider::setAppendToDataLabel | ( | const edm::ParameterSet & | iToAppend | ) |
This method is only to be called by the framework, it sets the string which will be appended to the labels of all data products being produced
Definition at line 104 of file DataProxyProvider.cc.
References appendToDataLabel_, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by edm::eventsetup::ComponentMaker< edm::eventsetup::LooperMakerTraits, TType >::setPostConstruction().
{ std::string oldValue( appendToDataLabel_); //this can only be changed once and the default value is the empty string assert(0 == oldValue.size()); const std::string kParamName("appendToDataLabel"); if(iToAppend.exists(kParamName) ) { appendToDataLabel_ = iToAppend.getParameter<std::string>(kParamName); } }
void edm::eventsetup::DataProxyProvider::setDescription | ( | const ComponentDescription & | iDescription | ) | [inline] |
Definition at line 73 of file DataProxyProvider.h.
References description_.
Referenced by edm::eventsetup::ComponentMaker< edm::eventsetup::LooperMakerTraits, TType >::setDescription().
{ description_ = iDescription; }
void edm::eventsetup::DataProxyProvider::usingRecord | ( | ) | [inline, protected] |
Definition at line 87 of file DataProxyProvider.h.
References usingRecordWithKey().
{ usingRecordWithKey(EventSetupRecordKey::makeKey<T>()); }
std::set< EventSetupRecordKey > DataProxyProvider::usingRecords | ( | ) | const |
Definition at line 125 of file DataProxyProvider.cc.
References recordProxies_.
{ std::set<EventSetupRecordKey> returnValue; for(RecordProxies::const_iterator itRecProxies = recordProxies_.begin(), itRecProxiesEnd = recordProxies_.end(); itRecProxies != itRecProxiesEnd; ++itRecProxies) { returnValue.insert(returnValue.end(), itRecProxies->first); } //copy_all(keys_, std::inserter(returnValue, returnValue.end())); return returnValue; }
void DataProxyProvider::usingRecordWithKey | ( | const EventSetupRecordKey & | iKey | ) | [protected] |
Definition at line 65 of file DataProxyProvider.cc.
References recordProxies_.
Referenced by CondDBESSource::CondDBESSource(), FWLiteESSource::delaySettingRecords(), and usingRecord().
{ recordProxies_[iKey]; //keys_.push_back(iKey); }
std::string edm::eventsetup::DataProxyProvider::appendToDataLabel_ [private] |
Definition at line 109 of file DataProxyProvider.h.
Referenced by keyedProxies(), and setAppendToDataLabel().
Definition at line 108 of file DataProxyProvider.h.
Referenced by description(), and setDescription().
Definition at line 107 of file DataProxyProvider.h.
Referenced by invalidateProxies(), isUsingRecord(), keyedProxies(), resetProxiesIfTransient(), usingRecords(), and usingRecordWithKey().