|
|
Go to the documentation of this file.
10 #include "TDictAttributeMap.h"
32 availableOnlyAtEndTransition_(
false),
33 isMergeable_(
false) {}
61 bool availableOnlyAtEndTransition,
62 std::set<std::string>
const& aliases)
63 : branchType_(branchType),
68 friendlyClassName_(friendlyClassName),
69 productInstanceName_(productInstanceName),
70 branchAliases_(aliases),
85 : branchType_(aliasForBranch.branchType()),
86 moduleLabel_(moduleLabelAlias),
89 fullClassName_(aliasForBranch.
className()),
90 friendlyClassName_(aliasForBranch.friendlyClassName()),
91 productInstanceName_(productInstanceAlias),
92 branchAliases_(aliasForBranch.branchAliases()),
93 aliasForBranchID_(aliasForBranch.branchID()),
111 char const underscore(
'_');
117 <<
"' contains an underscore ('_'), which is illegal in the name of a product.\n";
128 <<
"' contains an underscore ('_'), which is illegal in a product instance name.\n";
131 if (
processName_.find(underscore) != std::string::npos) {
134 <<
"' contains an underscore ('_'), which is illegal in a process name.\n";
141 brName += underscore;
143 brName += underscore;
145 brName += underscore;
193 if (
wp &&
wp->HasKey(
"persistent") && !strcmp(
wp->GetPropertyAsString(
"persistent"),
"false")) {
202 char const underscore(
'_');
203 if (
moduleLabel_.find(underscore) != std::string::npos) {
206 <<
"' contains an underscore ('_'), which is illegal in a module label.\n";
210 if (
wp &&
wp->HasKey(
"splitLevel")) {
211 setSplitLevel(strtol(
wp->GetPropertyAsString(
"splitLevel"),
nullptr, 0));
214 <<
" is specified for class " <<
wrappedName() <<
".'\n";
218 if (
wp &&
wp->HasKey(
"basketSize")) {
219 setBasketSize(strtol(
wp->GetPropertyAsString(
"basketSize"),
nullptr, 0));
222 <<
" is specified for class " <<
wrappedName() <<
"'.\n";
238 <<
") differs from aliasForBranch (" << aliasForBranch.
branchType()
239 <<
").\nPlease report this error to the FWCore developers";
243 "aliasForBranch.\nPlease report this error to the FWCore developers";
247 <<
"BranchDescription::setSwitchAliasForBranch: unwrapped type info (" <<
unwrappedTypeID().
name()
249 <<
").\nPlease report this error to the FWCore developers";
258 os <<
"Branch Type = " <<
branchType() << std::endl;
259 os <<
"Process Name = " <<
processName() << std::endl;
260 os <<
"ModuleLabel = " <<
moduleLabel() << std::endl;
261 os <<
"Branch ID = " <<
branchID() <<
'\n';
269 e <<
"Problem using an incomplete BranchDescription\n"
270 << txt <<
"\nPlease report this error to the FWCore developers";
301 if (
a.processName() <
b.processName())
303 if (
b.processName() <
a.processName())
305 if (
a.fullClassName() <
b.fullClassName())
307 if (
b.fullClassName() <
a.fullClassName())
309 if (
a.friendlyClassName() <
b.friendlyClassName())
311 if (
b.friendlyClassName() <
a.friendlyClassName())
313 if (
a.productInstanceName() <
b.productInstanceName())
315 if (
b.productInstanceName() <
a.productInstanceName())
317 if (
a.moduleLabel() <
b.moduleLabel())
319 if (
b.moduleLabel() <
a.moduleLabel())
321 if (
a.branchType() <
b.branchType())
323 if (
b.branchType() <
a.branchType())
325 if (
a.branchID() <
b.branchID())
327 if (
b.branchID() <
a.branchID())
329 if (
a.branchAliases() <
b.branchAliases())
331 if (
b.branchAliases() <
a.branchAliases())
333 if (
a.present() <
b.present())
335 if (
b.present() <
a.present())
341 return (
a.branchType() ==
b.branchType()) && (
a.processName() ==
b.processName()) &&
342 (
a.fullClassName() ==
b.fullClassName()) && (
a.friendlyClassName() ==
b.friendlyClassName()) &&
343 (
a.productInstanceName() ==
b.productInstanceName()) && (
a.moduleLabel() ==
b.moduleLabel()) &&
344 (
a.branchID() ==
b.branchID());
348 return combinable(
a,
b) && (
a.dropped() ==
b.dropped()) && (
a.branchAliases() ==
b.branchAliases());
352 std::ostringstream differences;
353 if (
a.branchName() !=
b.branchName()) {
354 differences <<
"Branch name '" <<
b.branchName() <<
"' does not match '" <<
a.branchName() <<
"'.\n";
361 if (
a.branchType() !=
b.branchType()) {
362 differences <<
"Branch '" <<
b.branchName() <<
"' is a(n) '" <<
b.branchType() <<
"' branch\n";
363 differences <<
" in file '" <<
fileName <<
"', but a(n) '" <<
a.branchType()
364 <<
"' branch in previous files.\n";
366 if (
a.branchID() !=
b.branchID()) {
367 differences <<
"Branch '" <<
b.branchName() <<
"' has a branch ID of '" <<
b.branchID() <<
"'\n";
368 differences <<
" in file '" <<
fileName <<
"', but '" <<
a.branchID() <<
"' in previous files.\n";
370 if (
a.fullClassName() !=
b.fullClassName()) {
371 differences <<
"Products on branch '" <<
b.branchName() <<
"' have type '" <<
b.fullClassName() <<
"'\n";
372 differences <<
" in file '" <<
fileName <<
"', but '" <<
a.fullClassName() <<
"' in previous files.\n";
374 if (!
b.dropped() &&
a.dropped()) {
375 differences <<
"Branch '" <<
a.branchName() <<
"' was dropped in the first input file but is present in '"
378 return differences.str();
bool availableOnlyAtEndTransition() const
std::string const & fullClassName() const
void throwExceptionWithText(char const *txt)
static TypeWithDict byName(std::string const &name)
std::string const & productInstanceName() const
void setBasketSize(int size)
void addContext(std::string const &context)
void setSplitLevel(int level)
bool availableOnlyAtEndTransition_
TypeWithDict const & unwrappedType() const
void setWrappedType(TypeWithDict const &type)
TypeWithDict const & wrappedType() const
ParameterSetID const & parameterSetID() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
std::set< std::string > branchAliases_
void setWrappedName(std::string const &name)
void write(std::ostream &os) const
std::string friendlyClassName_
void setOnDemand(bool isOnDemand)
void setProduced(bool isProduced)
BranchID switchAliasForBranchID_
void setDropped(bool isDropped)
std::string const & processName() const
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
void setUnwrappedType(TypeWithDict const &type)
static const int invalidSplitLevel
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
BranchID const & originalBranchID() const
std::string const & wrappedName() const
TypeID unwrappedTypeID() const
void setSwitchAliasForBranch(BranchDescription const &aliasForBranch)
void setID(std::string const &branchName)
std::string const & friendlyClassName() const
std::type_info const & typeInfo() const
std::string friendlyName(std::string const &iFullName)
const char * name() const
std::string fullClassName_
ParameterSetID parameterSetID_
BranchType const & branchType() const
std::string const & branchName() const
void initFromDictionary()
std::string wrappedClassName(std::string const &iFullName)
void updateFriendlyClassName()
std::string const & moduleName() const
TClass * getClass() const
std::string productInstanceName_
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
std::string const & moduleLabel() const
void merge(BranchDescription const &other)
void setTransient(bool isTransient)
std::set< std::string > const & branchAliases() const
static const int invalidBasketSize
std::string className(const T &t)
BranchID aliasForBranchID_
std::string moduleName(Provenance const &provenance, ProcessHistory const &history)
BranchID const & branchID() const
void throwIfInvalid_() const