29 namespace eventsetup {
36 : dataProxyContainer_(dataProxyContainer), recordIndex_(recordIndex), dataProxiesIndex_(
kInvalidIndex) {}
50 for (
auto const& it : proxies) {
56 for (
auto const& it : proxies) {
61 auto lengthDataLabel = std::strlen(it.first.name().value());
62 assert(std::strncmp(it.first.name().value(),
64 lengthDataLabel) == 0);
71 for (
auto const& it : proxies) {
79 auto iterEnd = iter + perRecordInfo.
nDataKeys_;
80 for (; iter != iterEnd; ++iter) {
81 if (*iter == dataKey) {
99 std::vector<DataKey>::iterator dataKeysIter,
101 : dataKeysIter_(dataKeysIter), dataProxiesIter_(dataProxiesIter) {}
120 assert(keyedProxiesCollection_.empty());
121 perRecordInfos_.emplace_back(iKey);
126 return (lb != perRecordInfos_.end() && iKey == lb->recordKey_);
130 std::set<EventSetupRecordKey> returnValue;
131 for (
auto const& it : perRecordInfos_) {
132 returnValue.insert(returnValue.end(), it.recordKey_);
138 std::set<EventSetupRecordKey>& recordsNotAllowingConcurrentIOVs)
const {
139 for (
auto const& it : perRecordInfos_) {
142 recordsNotAllowingConcurrentIOVs.insert(recordsNotAllowingConcurrentIOVs.end(),
key);
148 std::sort(perRecordInfos_.begin(), perRecordInfos_.end());
149 perRecordInfos_.erase(
std::unique(perRecordInfos_.begin(), perRecordInfos_.end()), perRecordInfos_.end());
153 unsigned int nConcurrentIOVs) {
154 if (keyedProxiesCollection_.empty()) {
155 sortEventSetupRecordKeys();
159 assert(lb != perRecordInfos_.end() &&
key == lb->recordKey_);
160 if (lb->nIOVs_ == 0) {
161 lb->nIOVs_ = nConcurrentIOVs;
162 auto recordIndex =
std::distance(perRecordInfos_.begin(), lb);
163 lb->indexToKeyedProxies_ = keyedProxiesCollection_.size();
164 for (
unsigned int i = 0;
i < nConcurrentIOVs; ++
i) {
165 keyedProxiesCollection_.emplace_back(
this, recordIndex);
173 assert(lb != perRecordInfos_.end() && iRecordKey == lb->recordKey_);
174 assert(iovIndex < lb->nIOVs_);
175 return keyedProxiesCollection_[lb->indexToKeyedProxies_ + iovIndex];
186 if (iToAppend.
exists(kParamName)) {
192 unsigned int iovIndex) {
197 std::vector<std::pair<DataKey, std::shared_ptr<DataProxy>>> keyedProxiesVector =
203 keyedProxy.dataProxy_->setProviderDescription(&
description());
204 if (mustChangeLabels) {
210 DataKey newKey(keyedProxy.dataKey_.type(),
temp.c_str());
211 swap(keyedProxy.dataKey_, newKey);
226 for (
auto&
v : iDesc) {
bool isLabelUnused(std::string const &label) const
T getParameter(std::string const &) const
bool isUsingRecord(const EventSetupRecordKey &) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
PerRecordInfo(const EventSetupRecordKey &)
unsigned int indexToDataKeys_
ParameterSetDescription * defaultDescription()
Returns 0 if no default has been assigned.
bool unInitialized() const
std::vector< PerRecordInfo > perRecordInfos_
virtual KeyedProxiesVector registerProxies(const EventSetupRecordKey &, unsigned int iovIndex)=0
void fillRecordsNotAllowingConcurrentIOVs(std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
void sortEventSetupRecordKeys()
unsigned int dataProxiesIndex_
unsigned int size() const
def unique(seq, keepstr=True)
std::vector< edm::propagate_const< std::shared_ptr< DataProxy > > > dataProxies_
KeyedProxies & keyedProxies(const EventSetupRecordKey &iRecordKey, unsigned int iovIndex)
void swap(DataKey &a, DataKey &b)
static const std::string kAppendToDataLabel("appendToDataLabel")
virtual void updateLookup(ESRecordsToProxyIndices const &)
bool allowConcurrentIOVs(EventSetupRecordKey const &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const ComponentDescription & description() const
edm::propagate_const< DataProxyContainer * > dataProxyContainer_
static void prevalidate(ConfigurationDescriptions &)
void setAppendToDataLabel(const edm::ParameterSet &)
void insert(std::vector< std::pair< DataKey, std::shared_ptr< DataProxy >>> &&, std::string const &appendToDataLabel)
KeyedProxies & keyedProxies(const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
DataProxyContainer dataProxyContainer_
void createKeyedProxies(EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
std::set< EventSetupRecordKey > usingRecords() const
EventSetupRecordKey const & recordKey() const
unsigned int recordIndex_
bool contains(DataKey const &dataKey) const
Iterator(std::vector< DataKey >::iterator dataKeysIter, std::vector< edm::propagate_const< std::shared_ptr< DataProxy >>>::iterator dataProxiesIter)
constexpr auto kInvalidIndex
std::vector< DataKey > dataKeys_
virtual ~DataProxyProvider() noexcept(false)
void usingRecordWithKey(const EventSetupRecordKey &)
std::string appendToDataLabel_
KeyedProxies(DataProxyContainer *, unsigned int recordIndex)