60 #include "THashTable.h" 74 missingDictionaries.emplace_back(typeID.
className());
83 return checkDictionary(missingDictionaries, wrappedName, wrappedTypeWithDict);
89 return checkDictionary(missingDictionaries, wrappedName, wrappedTypeWithDict);
96 missingDictionaries.emplace_back(name);
110 TClass* tClass = TClass::GetClass(typeID.
typeInfo());
114 tClass = TClass::GetClass(typeID.
typeInfo());
117 missingDictionaries.emplace_back(typeID.
className());
121 if (tClass ==
nullptr) {
127 THashTable hashTable;
129 tClass->GetMissingDictionaries(hashTable, recursive);
131 for (
auto const& item : hashTable) {
132 TClass
const*
cl =
static_cast<TClass const*
>(item);
133 missingDictionaries.emplace_back(cl->GetName());
143 missingDictionaries.emplace_back(name);
147 TClass* tClass = typeWithDict.
getClass();
148 if (tClass ==
nullptr) {
149 missingDictionaries.emplace_back(name);
153 THashTable hashTable;
155 tClass->GetMissingDictionaries(hashTable, recursive);
159 for (
auto const& item : hashTable) {
160 TClass
const*
cl =
static_cast<TClass const*
>(item);
161 missingDictionaries.emplace_back(cl->GetName());
168 std::vector<std::string>& missingDictionaries,
170 std::sort(missingDictionaries.begin(), missingDictionaries.end());
171 missingDictionaries.erase(
std::unique(missingDictionaries.begin(), missingDictionaries.end()),
172 missingDictionaries.end());
174 std::ostringstream ostr;
175 for (
auto const& item : missingDictionaries) {
176 ostr <<
" " << item <<
"\n";
178 exception <<
"No data dictionary found for the following classes:\n\n" 179 << ostr.str() <<
"\n" 180 <<
"Most likely each dictionary was never generated, but it may\n" 181 <<
"be that it was generated in the wrong package. Please add\n" 182 <<
"(or move) the specification \'<class name=\"whatever\"/>\' to\n" 183 <<
"the appropriate classes_def.xml file along with any other\n" 184 <<
"information needed there. For example, if this class has any\n" 185 <<
"transient members, you need to specify them in classes_def.xml.\n" 186 <<
"Also include the class header in classes.h\n";
188 if (!context.empty()) {
194 std::vector<std::string>
empty;
200 std::vector<std::string>& producedTypes) {
204 if (!producedTypes.empty()) {
205 std::sort(producedTypes.begin(), producedTypes.end());
206 producedTypes.erase(
std::unique(producedTypes.begin(), producedTypes.end()), producedTypes.end());
208 std::ostringstream ostr;
209 for (
auto const& item : producedTypes) {
210 ostr <<
" " << item <<
"\n";
212 exception <<
"\nA type listed above might or might not be the same as a\n" 213 <<
"type declared by a producer module with the function \'produces\'.\n" 214 <<
"Instead it might be the type of a data member, base class,\n" 215 <<
"wrapped type, or other object needed by a produced type. Below\n" 216 <<
"is some additional information which lists the types declared\n" 217 <<
"to be produced by a producer module that are associated with\n" 218 <<
"the types whose dictionaries were not found:\n\n" 219 << ostr.str() <<
"\n";
226 std::vector<std::string>& producedTypes,
228 bool fromStreamerSource) {
232 if (!producedTypes.empty()) {
233 std::sort(producedTypes.begin(), producedTypes.end());
234 producedTypes.erase(
std::unique(producedTypes.begin(), producedTypes.end()), producedTypes.end());
236 std::ostringstream ostr;
237 for (
auto const& item : producedTypes) {
238 ostr <<
" " << item <<
"\n";
240 if (fromStreamerSource) {
241 exception <<
"\nA type listed above might or might not be the same as a\n" 242 <<
"type stored in the Event. Instead it might be the type of\n" 243 <<
"a data member, base class, wrapped type, or other object\n" 244 <<
"needed by a stored type. Below is some additional information\n" 245 <<
"which lists the stored types associated with the types whose\n" 246 <<
"dictionaries were not found:\n\n" 247 << ostr.str() <<
"\n";
249 exception <<
"\nA type listed above might or might not be the same as a\n" 250 <<
"type stored in the Event (or Lumi or Run). Instead it might\n" 251 <<
"be the type of a data member, base class, wrapped type, or\n" 252 <<
"other object needed by a stored type. Below is some additional\n" 253 <<
"information which lists the stored types associated with the\n" 254 <<
"types whose dictionaries were not found:\n\n" 255 << ostr.str() <<
"\n";
259 if (!branchNames.empty()) {
260 std::sort(branchNames.begin(), branchNames.end());
261 branchNames.erase(
std::unique(branchNames.begin(), branchNames.end()), branchNames.end());
263 std::ostringstream ostr;
264 for (
auto const& item : branchNames) {
265 ostr <<
" " << item <<
"\n";
267 if (fromStreamerSource) {
268 exception <<
"Missing dictionaries are associated with these branch names:\n\n" << ostr.str() <<
"\n";
270 exception <<
"Missing dictionaries are associated with these branch names:\n\n" 271 << ostr.str() <<
"\n" 272 <<
"If you do not need these branches and they are not produced\n" 273 <<
"in the current process, an alternate solution to adding\n" 274 <<
"dictionaries is to drop these branches on input using the\n" 275 <<
"inputCommands parameter of the PoolSource.";
283 std::set<std::string>& producedTypes,
284 bool consumedWithView) {
288 if (!producedTypes.empty()) {
289 std::ostringstream ostr;
290 for (
auto const& item : producedTypes) {
291 ostr <<
" " << item <<
"\n";
293 if (consumedWithView) {
294 exception <<
"\nThe list of types above was generated while checking for\n" 295 <<
"dictionaries related to products declared to be consumed\n" 296 <<
"using a View. They will be either the type or a base class\n" 297 <<
"of the type declared in a consumes declaration as the template\n" 298 <<
"parameter of a View. Below is some additional information\n" 299 <<
"which lists the type of the template parameter of the View.\n" 300 <<
"(It will be the same type unless the missing dictionary is\n" 301 <<
"for a base type):\n\n" 302 << ostr.str() <<
"\n";
304 exception <<
"\nThe list of types above was generated while checking for\n" 305 <<
"dictionaries related to products declared to be consumed.\n" 306 <<
"A type listed above might or might not be a type declared\n" 307 <<
"to be consumed. Instead it might be the type of a data member,\n" 308 <<
"base class, wrapped type or other object needed by a consumed\n" 309 <<
"type. Below is some additional information which lists\n" 310 <<
"the types declared to be consumed by a module and which\n" 311 <<
"are associated with the types whose dictionaries were not\n" 313 << ostr.str() <<
"\n";
321 std::vector<TypeWithDict>& baseTypes) {
327 if (!typeWithDict.isClass()) {
332 bool returnValue =
true;
333 for (
auto const& basex : bases) {
348 baseTypes.push_back(baseType);
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
bool public_base_classes(std::vector< std::string > &missingDictionaries, TypeID const &typeID, std::vector< TypeWithDict > &baseTypes)
const std::type_info & typeInfo() const
static TypeWithDict byName(std::string const &name)
bool invalidTypeInfo() const
TClass * getClass() const
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
def unique(seq, keepstr=True)
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
std::type_info const & typeInfo() const
TypeWithDict typeOf() const
base
Make Sure CMSSW is Setup ##.
std::string wrappedClassName(std::string const &iFullName)
bool search_all(ForwardSequence const &s, Datum const &d)
void addContext(std::string const &context)
void addToMissingDictionariesException(edm::Exception &exception, std::vector< std::string > &missingDictionaries, std::string const &context)
std::string const & className() const
bool hasDictionary(std::type_info const &)
bool checkDictionaryOfWrappedType(std::vector< std::string > &missingDictionaries, TypeID const &unwrappedTypeID)