def genHandlesSrc(handles):
    (uniqeHandles, duplicatedHandles) = splitUniqueAndDuplicatedEntries(handles)

    def genLines(handles):
        for handle in uniqeHandles:
            if (handle.type == Handle.TYPE_DISP):
                (yield ('VK_DEFINE_HANDLE\t(%s,\t%s);' % (handle.name, handle.getHandleType())))
            elif (handle.type == Handle.TYPE_NONDISP):
                (yield ('VK_DEFINE_NON_DISPATCHABLE_HANDLE\t(%s,\t%s);' % (handle.name, handle.getHandleType())))
        for duplicate in duplicatedHandles:
            if (duplicate.type == Handle.TYPE_DISP):
                (yield ('VK_DEFINE_HANDLE\t(%s,\t%s);' % (duplicate.name, duplicatedHandles[duplicate].getHandleType())))
            elif (duplicate.type == Handle.TYPE_NONDISP):
                (yield ('VK_DEFINE_NON_DISPATCHABLE_HANDLE\t(%s,\t%s);' % (duplicate.name, duplicatedHandles[duplicate].getHandleType())))
    for line in indentLines(genLines(handles)):
        (yield line)
def genHandlesSrc(handles):
    (uniqeHandles, duplicatedHandles) = splitUniqueAndDuplicatedEntries(handles)

    def genLines(handles):
        for handle in uniqeHandles:
            if (handle.type == Handle.TYPE_DISP):
                (yield ('VK_DEFINE_HANDLE\t(%s,\t%s);' % (handle.name, handle.getHandleType())))
            elif (handle.type == Handle.TYPE_NONDISP):
                (yield ('VK_DEFINE_NON_DISPATCHABLE_HANDLE\t(%s,\t%s);' % (handle.name, handle.getHandleType())))
        for duplicate in duplicatedHandles:
            if (duplicate.type == Handle.TYPE_DISP):
                (yield ('VK_DEFINE_HANDLE\t(%s,\t%s);' % (duplicate.name, duplicatedHandles[duplicate].getHandleType())))
            elif (duplicate.type == Handle.TYPE_NONDISP):
                (yield ('VK_DEFINE_NON_DISPATCHABLE_HANDLE\t(%s,\t%s);' % (duplicate.name, duplicatedHandles[duplicate].getHandleType())))
    for line in indentLines(genLines(handles)):
        (yield line)