Hi
I am running a python script that checks the dictionaries of a data class defined in classes_def.xml and classes.h shown below. The script calls TClass::GetStreamerInfo() which produces the error message shown below. Is this output expected?
edmCheckClassVersion.py -l libDataFormatsTestObjects.so -d -x DataFormats/TestObjects/src/classes_def.xml
Error in TStreamerInfo::Build: edmtest::TransientIntProduct, unknown type: edmtest::ProductWithNoDictionary dummy
The error goes away if I add this line to classes_def.xml
<class name="edmtest::ProductWithNoDictionary” transient=“true”/>
Is this the correct remedy?
Patrick Gartung
*********** class_def.xml ***************
************ classes.h *****************
namespace edmtest {
// Toy products
struct ProductWithNoDictionary {
};
struct TransientIntProduct {
explicit TransientIntProduct(int i = 0) : value(i) {}
~TransientIntProduct() {}
typedef unsigned int cms_uint32_t;
cms_uint32_t value;
ProductWithNoDictionary dummy;
};
}
namespace DataFormats_TestObjects {
struct dictionary {
edmtest::TransientIntProduct dummyw13t;
};
}
**************** excerpt from edmCheckClassVersion.py ***************
recursively check the base classes for a class pointer
as building the streamer will crash if base classes are
incomplete
def verifyBaseClasses© :
missingBase = 0
check that all bases are loaded
bases = c.GetListOfBases()
if not bases :
print "Incomplete class ", c.GetName()
return 1
for b in bases :
bc = b.GetClassPointer()
if bc :
missingBase += verifyBaseClasses(bc)
else :
print "Incomplete base class for ", c.GetName(), ": ", b.GetName()
missingBase += 1
return missingBase
def checkDictionaries(name):
c = ROOT.TClass.GetClass(name)
if not c:
raise RuntimeError(“failed to load dictionary for class '”+name+"’")
missingDict = verifyBaseClasses©
if missingDict == 0 :
si = c.GetStreamerInfo()
if si :
ts = si.GetElements()
for telem in ts :
clm = telem.GetClassPointer()
if clm and not clm.IsLoaded() :
print "Missing dictionary for ", telem.GetName(), " type ", clm.GetName();
missingDict += 1
else :
print "No streamer info for ", c.GetName()
missingDict += 1
return missingDict