Index: Source/bindings/scripts/compute_interfaces_info_individual.py |
diff --git a/Source/bindings/scripts/compute_interfaces_info_individual.py b/Source/bindings/scripts/compute_interfaces_info_individual.py |
index 9876b028a180389f04f3e2d1a90aa096d0bd333e..8f10a4a5f2c6c82bf67c05ed0d71282de5a0f7a5 100755 |
--- a/Source/bindings/scripts/compute_interfaces_info_individual.py |
+++ b/Source/bindings/scripts/compute_interfaces_info_individual.py |
@@ -168,6 +168,7 @@ class InterfaceInfoCollector(object): |
'full_paths': [], |
'include_paths': [], |
}) |
+ self.enumerations = set() |
self.union_types = set() |
self.typedefs = {} |
@@ -207,8 +208,13 @@ class InterfaceInfoCollector(object): |
this_union_types = collect_union_types_from_definitions(definitions) |
self.union_types.update(this_union_types) |
- |
self.typedefs.update(definitions.typedefs) |
+ # Check enum duplication. |
+ for enum_name in definitions.enumerations.keys(): |
+ for defined_enum in self.enumerations: |
+ if defined_enum.name == enum_name: |
+ raise Exception('Enumeration %s has multiple definitions' % enum_name) |
+ self.enumerations.update(definitions.enumerations.values()) |
extended_attributes = definition.extended_attributes |
implemented_as = extended_attributes.get('ImplementedAs') |
@@ -262,6 +268,8 @@ class InterfaceInfoCollector(object): |
def get_component_info_as_dict(self): |
"""Returns component wide information as a dict.""" |
return { |
+ 'enumerations': dict((enum.name, enum.values) |
+ for enum in self.enumerations), |
'typedefs': self.typedefs, |
'union_types': self.union_types, |
} |