10 #include "TDictAttributeMap.h" 33 availableOnlyAtEndTransition_(
false),
34 isMergeable_(
false) {}
62 bool availableOnlyAtEndTransition,
63 std::set<std::string>
const& aliases)
64 : branchType_(branchType),
69 friendlyClassName_(friendlyClassName),
70 productInstanceName_(productInstanceName),
71 branchAliases_(aliases),
86 : branchType_(aliasForBranch.branchType()),
87 moduleLabel_(moduleLabelAlias),
90 fullClassName_(aliasForBranch.
className()),
91 friendlyClassName_(aliasForBranch.friendlyClassName()),
92 productInstanceName_(productInstanceAlias),
93 branchAliases_(aliasForBranch.branchAliases()),
94 aliasForBranchID_(aliasForBranch.branchID()),
112 char const underscore(
'_');
118 <<
"' contains an underscore ('_'), which is illegal in the name of a product.\n";
129 <<
"' contains an underscore ('_'), which is illegal in a product instance name.\n";
132 if (
processName_.find(underscore) != std::string::npos) {
135 <<
"' contains an underscore ('_'), which is illegal in a process name.\n";
142 brName += underscore;
144 brName += underscore;
146 brName += underscore;
194 if (
wp &&
wp->HasKey(
"persistent") && !strcmp(
wp->GetPropertyAsString(
"persistent"),
"false")) {
203 char const underscore(
'_');
204 if (
moduleLabel_.find(underscore) != std::string::npos) {
207 <<
"' contains an underscore ('_'), which is illegal in a module label.\n";
211 if (
wp &&
wp->HasKey(
"splitLevel")) {
212 setSplitLevel(strtol(
wp->GetPropertyAsString(
"splitLevel"),
nullptr, 0));
215 <<
" is specified for class " <<
wrappedName() <<
".'\n";
219 if (
wp &&
wp->HasKey(
"basketSize")) {
220 setBasketSize(strtol(
wp->GetPropertyAsString(
"basketSize"),
nullptr, 0));
223 <<
" is specified for class " <<
wrappedName() <<
"'.\n";
239 <<
") differs from aliasForBranch (" << aliasForBranch.
branchType()
240 <<
").\nPlease report this error to the FWCore developers";
244 "aliasForBranch.\nPlease report this error to the FWCore developers";
248 <<
"BranchDescription::setSwitchAliasForBranch: unwrapped type info (" <<
unwrappedTypeID().
name()
250 <<
").\nPlease report this error to the FWCore developers";
259 os <<
"Branch Type = " <<
branchType() << std::endl;
260 os <<
"Process Name = " <<
processName() << std::endl;
261 os <<
"ModuleLabel = " <<
moduleLabel() << std::endl;
262 os <<
"Branch ID = " <<
branchID() <<
'\n';
270 e <<
"Problem using an incomplete BranchDescription\n" 271 << txt <<
"\nPlease report this error to the FWCore developers";
302 if (
a.processName() <
b.processName())
304 if (
b.processName() <
a.processName())
306 if (
a.fullClassName() <
b.fullClassName())
308 if (
b.fullClassName() <
a.fullClassName())
310 if (
a.friendlyClassName() <
b.friendlyClassName())
312 if (
b.friendlyClassName() <
a.friendlyClassName())
314 if (
a.productInstanceName() <
b.productInstanceName())
316 if (
b.productInstanceName() <
a.productInstanceName())
318 if (
a.moduleLabel() <
b.moduleLabel())
320 if (
b.moduleLabel() <
a.moduleLabel())
322 if (
a.branchType() <
b.branchType())
324 if (
b.branchType() <
a.branchType())
326 if (
a.branchID() <
b.branchID())
328 if (
b.branchID() <
a.branchID())
330 if (
a.branchAliases() <
b.branchAliases())
332 if (
b.branchAliases() <
a.branchAliases())
334 if (
a.present() <
b.present())
336 if (
b.present() <
a.present())
342 return (
a.branchType() ==
b.branchType()) && (
a.processName() ==
b.processName()) &&
343 (
a.fullClassName() ==
b.fullClassName()) && (
a.friendlyClassName() ==
b.friendlyClassName()) &&
344 (
a.productInstanceName() ==
b.productInstanceName()) && (
a.moduleLabel() ==
b.moduleLabel()) &&
345 (
a.branchID() ==
b.branchID());
349 return combinable(
a,
b) && (
a.dropped() ==
b.dropped()) && (
a.branchAliases() ==
b.branchAliases());
353 std::ostringstream differences;
354 if (
a.branchName() !=
b.branchName()) {
355 differences <<
"Branch name '" <<
b.branchName() <<
"' does not match '" <<
a.branchName() <<
"'.\n";
362 if (
a.branchType() !=
b.branchType()) {
363 differences <<
"Branch '" <<
b.branchName() <<
"' is a(n) '" <<
b.branchType() <<
"' branch\n";
364 differences <<
" in file '" <<
fileName <<
"', but a(n) '" <<
a.branchType()
365 <<
"' branch in previous files.\n";
367 if (
a.branchID() !=
b.branchID()) {
368 differences <<
"Branch '" <<
b.branchName() <<
"' has a branch ID of '" <<
b.branchID() <<
"'\n";
369 differences <<
" in file '" <<
fileName <<
"', but '" <<
a.branchID() <<
"' in previous files.\n";
371 if (
a.fullClassName() !=
b.fullClassName()) {
372 differences <<
"Products on branch '" <<
b.branchName() <<
"' have type '" <<
b.fullClassName() <<
"'\n";
373 differences <<
" in file '" <<
fileName <<
"', but '" <<
a.fullClassName() <<
"' in previous files.\n";
375 if (!
b.dropped() &&
a.dropped()) {
376 differences <<
"Branch '" <<
a.branchName() <<
"' was dropped in the first input file but is present in '" 379 return differences.str();
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
constexpr bool operator==(ELseverityLevel const &e1, ELseverityLevel const &e2) noexcept
const char * name() const
ParameterSetID const & parameterSetID() const
static int const invalidSplitLevel
BranchID const & branchID() const
static int const invalidBasketSize
BranchType const & branchType() const
void setOnDemand(bool isOnDemand)
std::string const & fullClassName() const
std::string const & moduleName() const
TypeID unwrappedTypeID() const
std::string const & processName() const
TypeWithDict const & unwrappedType() const
std::string const & friendlyClassName() const
void setWrappedType(TypeWithDict const &type)
static TypeWithDict byName(std::string const &name)
BranchID switchAliasForBranchID_
void setTransient(bool isTransient)
BranchID aliasForBranchID_
std::string friendlyName(std::string const &iFullName)
std::string const & branchName() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
std::string fullClassName_
void initFromDictionary()
std::string const & productInstanceName() const
void setWrappedName(std::string const &name)
void setSplitLevel(int level)
std::string productInstanceName_
void throwIfInvalid_() const
void setDropped(bool isDropped)
void updateFriendlyClassName()
std::string const & wrappedName() const
void throwExceptionWithText(char const *txt)
bool availableOnlyAtEndTransition_
std::type_info const & typeInfo() const
std::string wrappedClassName(std::string const &iFullName)
void addContext(std::string const &context)
void write(std::ostream &os) const
TClass * getClass() const
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
std::set< std::string > branchAliases_
bool availableOnlyAtEndTransition() const
std::string friendlyClassName_
ParameterSetID parameterSetID_
void setUnwrappedType(TypeWithDict const &type)
void setBasketSize(int size)
void setProduced(bool isProduced)
void setSwitchAliasForBranch(BranchDescription const &aliasForBranch)
std::string const & moduleLabel() const
TypeWithDict const & wrappedType() const
std::string className(const T &t)
std::set< std::string > const & branchAliases() const
void setID(std::string const &branchName)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
void merge(BranchDescription const &other)
BranchID const & originalBranchID() const