25 processHistoryID_(processHistoryPtr_->id()),
26 processConfiguration_(&pc),
34 std::string
const source(
"source");
36 for(ProductRegistry::ProductList::const_iterator itProdInfo = prodsList.begin(),
37 itProdInfoEnd = prodsList.end();
38 itProdInfo != itProdInfoEnd;
40 if (itProdInfo->second.branchType() ==
branchType_) {
43 if (bd->moduleLabel() ==
source) {
45 }
else if(bd->onDemand()) {
83 for(ProductRegistry::ProductList::const_iterator itProdInfo = prodsList.begin(),
84 itProdInfoEnd = prodsList.end();
85 itProdInfo != itProdInfoEnd;
87 if (!itProdInfo->second.produced() && (itProdInfo->second.branchType() ==
branchType_)) {
131 (*i)->resetGroupData();
189 <<
"addGroupOrThrow: Problem found while adding product, "
190 <<
"product already exists for ("
222 if (resolveProd && !g->productUnavailable()) {
234 preg_->productLookup(),
241 <<
"getBySelector: Found zero products matching all criteria\n"
242 <<
"Looking for type: " << productType <<
"\n";
247 <<
"getBySelector: Found " << nFound <<
" products rather than one which match all criteria\n"
248 <<
"Looking for type: " << productType <<
"\n";
255 std::string
const&
label,
256 std::string
const& productInstanceName,
257 std::string
const& processName,
258 size_t& cachedOffset,
259 int& fillCount)
const {
264 preg_->productLookup(),
275 <<
"getByLabel: Found zero products matching all criteria\n"
276 <<
"Looking for type: " << productType <<
"\n"
277 <<
"Looking for module label: " << label <<
"\n"
278 <<
"Looking for productInstanceName: " << productInstanceName <<
"\n"
279 << (processName.empty() ?
"" :
"Looking for process: ") << processName <<
"\n";
292 preg_->productLookup(),
306 preg_->productLookup(),
313 <<
"getByType: Found zero products matching all criteria\n"
314 <<
"Looking for type: " << productType <<
"\n";
319 <<
"getByType: Found " << nFound <<
" products rather than one which match all criteria\n"
320 <<
"Looking for type: " << productType <<
"\n";
332 preg_->productLookup(),
346 preg_->elementLookup(),
356 assert(results.empty());
363 if(range.first == range.second) {
367 results.reserve(range.second - range.first);
371 if(selector.
match(*(it->branchDescription()))) {
376 if (group && !group->productUnavailable()) {
380 if (!group->productUnavailable() && !group->onDemand()) {
382 BasicHandle bh(group->product(), group->provenance());
383 results.push_back(bh);
388 return results.size();
405 if(range.first == range.second) {
411 if(it->processIndex() > processLevelFound) {
416 if(selector.
match(*(it->branchDescription()))) {
421 if (group && !group->productUnavailable()) {
425 if (!group->productUnavailable() && !group->onDemand()) {
426 if(it->processIndex() < processLevelFound) {
427 processLevelFound = it->processIndex();
432 result =
BasicHandle(group->product(), group->provenance());
447 std::string
const& productInstanceName,
448 std::string
const& processName,
449 size_t& cachedOffset,
455 bool isCached = (fillCount > 0 && fillCount == typeLookup.
fillCount());
456 bool toBeCached = (fillCount >= 0 && !isCached);
458 std::pair<TypeLookup::const_iterator, TypeLookup::const_iterator> range =
462 cachedOffset = range.first - typeLookup.
begin();
466 if(range.first == range.second) {
468 cachedOffset = typeLookup.
end() - typeLookup.
begin();
473 if (!processName.empty()) {
475 assert(processName == range.first->branchDescription()->processName());
476 range.second = range.first + 1;
477 }
else if (toBeCached) {
478 bool processFound =
false;
480 if (it->isFirst() && it != range.first) {
483 if (processName == it->branchDescription()->processName()) {
486 cachedOffset = range.first - typeLookup.
begin();
487 range.second = range.first + 1;
492 cachedOffset = typeLookup.
end() - typeLookup.
begin();
499 if (it->isFirst() && it != range.first) {
502 if (!processName.empty() && processName != it->branchDescription()->processName()) {
508 if (group && !group->productUnavailable()) {
512 if (!group->productUnavailable() && !group->onDemand()) {
514 result =
BasicHandle(group->product(), group->provenance());
527 <<
"No entry is present for this branch.\n"
528 <<
"The branch id is " << bid <<
"\n"
529 <<
"Contact a framework developer.\n";
531 if (!g->provenance() || (!g->product() && !g->productProvenancePtr())) {
534 return OutputHandle(g->product().get(), &g->branchDescription(), g->productProvenancePtr());
542 <<
"getProvenance: no product with given branch id: "<< bid <<
"\n";
552 <<
"getProvenance: no product with given BranchID: "<< bid <<
"\n";
555 return *g->provenance();
565 if ((*i)->provenanceAvailable()) {
568 if ((*i)->provenance()->product().present()) {
569 provenances.push_back((*i)->provenance());
577 for (std::vector<BranchID>::const_iterator it = bids.begin(), itEnd = bids.end(); it != itEnd; ++it) {
596 if (tag.
typeID() != tid ||
609 if (prod.get() == 0)
return;
613 if (alreadyPresent) {
659 if (
preg_->constProductList().size() >
groups_.size()) {
669 for(ProductRegistry::ProductList::const_iterator itProdInfo = prodsList.begin(),
670 itProdInfoEnd = prodsList.end();
671 itProdInfo != itProdInfoEnd;
673 if (itProdInfo->second.branchType() ==
branchType_) {
678 assert(!itProdInfo->second.produced());
std::string const & processName() const
void maybeFlushCache(TypeID const &tid, InputTag const &tag) const
ProductRegistry const & productRegistry() const
boost::shared_ptr< BranchMapper > branchMapperPtr_
void swapBase(Principal &)
size_t findGroup(TypeID const &typeID, TypeLookup const &typeLookup, SelectorBase const &selector, BasicHandle &result) const
void addGroupScheduled(boost::shared_ptr< ConstBranchDescription > bd)
boost::shared_ptr< DelayedReader > store() const
SharedConstGroupPtr const getGroupByIndex(ProductTransientIndex const &oid, bool resolveProd, bool fillOnDemand) const
ConstProductList & constProductList() const
BasicHandle getByLabel(TypeID const &tid, std::string const &label, std::string const &productInstanceName, std::string const &processName, size_t &cachedOffset, int &fillCount) const
Principal(boost::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, BranchType bt)
const_iterator end() const
const_iterator end() const
void addGroup_(std::auto_ptr< Group > g)
Group * getExistingGroup(BranchID const &branchID)
void putOrMerge(std::auto_ptr< EDProduct > prod, Group const *group) const
void addGroupOrThrow(std::auto_ptr< Group > g)
std::map< BranchKey, BranchDescription > ProductList
ProcessHistoryID processHistoryID_
static ProductTransientIndex const kInvalidIndex
void getAllProvenance(std::vector< Provenance const * > &provenances) const
bool getMapped(key_type const &k, value_type &result) const
boost::shared_ptr< ProductRegistry const > preg_
std::string const & friendlyClassName() const
void addGroupSource(boost::shared_ptr< ConstBranchDescription > bd)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
boost::shared_ptr< ProcessHistory > processHistoryPtr_
void resolveProduct(Group const &g, bool fillOnDemand) const
ProductLookupIndexList::const_iterator const_iterator
bool match(ConstBranchDescription const &p) const
std::string const & processName() const
ProductList const & productList() const
U second(std::pair< T, U > const &p)
const_iterator begin() const
bool const & dropped() const
boost::shared_ptr< Group > SharedGroupPtr
const T & max(const T &a, const T &b)
void getMany(TypeID const &tid, SelectorBase const &, BasicHandleVec &results) const
void putProduct(std::auto_ptr< EDProduct > edp, boost::shared_ptr< ProductProvenance > productProvenance)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::string const & productInstanceName() const
void setProcessHistory(Principal const &principal)
BranchType const & branchType() const
size_t findGroups(TypeID const &typeID, TypeLookup const &typeLookup, SelectorBase const &selector, BasicHandleVec &results) const
void fillPrincipal(ProcessHistoryID const &hist, boost::shared_ptr< BranchMapper > mapper, boost::shared_ptr< DelayedReader > rtrv)
void checkUniquenessAndType(std::auto_ptr< EDProduct > &prod, Group const *group) const
size_t getMatchingSequence(TypeID const &typeID, SelectorBase const &selector, BasicHandle &result) const
BranchID const & branchID() const
OutputHandle getForOutput(BranchID const &bid, bool getProd) const
virtual EDProduct const * getIt(ProductID const &) const
bool putOrMergeProduct() const
std::string const & className() const
void checkType(EDProduct const &prod) const
std::pair< const_iterator, const_iterator > equal_range(TypeInBranchType const &) const
returns a pair of iterators that define the range for items matching the TypeInBranchType ...
const_iterator begin() const
SharedConstGroupPtr const getGroup(BranchID const &oid, bool resolveProd, bool fillOnDemand) const
void getManyByType(TypeID const &tid, BasicHandleVec &results) const
std::set< EDProduct * > productPtrs_
std::string const & branchName() const
void addGroupInput(boost::shared_ptr< ConstBranchDescription > bd)
BasicHandle getByType(TypeID const &tid) const
boost::filter_iterator< FilledGroupPtr, GroupCollection::const_iterator > const_iterator
author Stefano ARGIRO author Bill Tanenbaum
virtual bool unscheduledFill(std::string const &moduleLabel) const =0
bool adjustToNewProductRegistry(ProductRegistry const ®)
BasicHandle getBySelector(TypeID const &tid, SelectorBase const &s) const
bool findGroupByLabel(TypeID const &typeID, TypeLookup const &typeLookup, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName, size_t &cachedOffset, int &fillCount, BasicHandle &result) const
void resetBranchDescription(boost::shared_ptr< ConstBranchDescription > bd)
std::vector< boost::shared_ptr< Group > > GroupCollection
boost::shared_ptr< BranchMapper > branchMapperPtr() const
TransientProductLookupMap TypeLookup
static ThreadSafeRegistry * instance()
void adjustIndexesAfterProductRegistryAddition()
bool productUnavailable() const
void mergeProduct(std::auto_ptr< EDProduct > edp, boost::shared_ptr< ProductProvenance > productProvenance)
Provenance getProvenance(BranchID const &bid) const
void recombine(Principal &other, std::vector< BranchID > const &bids)
boost::shared_ptr< Group const > SharedConstGroupPtr
ProcessConfiguration const * processConfiguration_
tuple size
Write out results.
ConstBranchDescription const & branchDescription() const
bool notEmpty() const
Return true if there are any contained value_type objects.
std::vector< BasicHandle > BasicHandleVec
std::string const & moduleLabel() const
boost::shared_ptr< DelayedReader > store_
void addOnDemandGroup(boost::shared_ptr< ConstBranchDescription > bd)
const std::string * moduleLabel() const