Warning, /DataFormats/Portable/scripts/portableHostCollectionHints is written in an unsupported language. File is not indexed.
0001 #!/usr/bin/env python3
0002
0003 import sys
0004
0005 # Get collectionand SoAs names
0006 if len(sys.argv) < 3:
0007 raise RuntimeError("Expecting at least one portable collection name and one layout name.")
0008
0009 collectionName = sys.argv[1]
0010 layouts = sys.argv[2:]
0011 for i in range(len(layouts)):
0012 layouts[i] += "<128, false>"
0013
0014 print("In <module>/src/classes_def.xml (with necessary includes in <module>/src/classes.h):\n")
0015 print("<lcgdict>")
0016 for l in layouts:
0017 print(" <class name=\"%s\"/>"% l)
0018 print()
0019 if len(layouts) > 1:
0020 print(" <!-- Recursive templates (with no data) ensuring we have one CollectionLeaf<index, type> for each layout in the collection -->")
0021 for i in range(0, len(layouts)):
0022 print(" <class name=\"portablecollection::CollectionImpl<%d"% i, end='')
0023 for l in layouts[i:]:
0024 print(", %s"%l, end='')
0025 print(">\"/>")
0026 print("\n <!-- Recursive templates implementing the association of indices and layouts, and containing the data -->")
0027 for i in range(0, len(layouts)):
0028 print(" <class name=\"portablecollection::CollectionLeaf<%d, %s>\"/>" % (i, layouts[i]))
0029 print("")
0030 print(" <!-- Collection declaration for dictionary -->")
0031 print(" <class name=\"%s\"/>"% collectionName)
0032 print(" <class name=\"edm::Wrapper<%s>\" splitLevel=\"0\"/>"% collectionName)
0033 print("</lcgdict>")