Skip to content

Commit

Permalink
Include base type in the set of dependent types
Browse files Browse the repository at this point in the history
Without including the base type in the dependent types, the initial call to construct a
DDS topic succeeds at the C API level, but then constructing a C-based deserialiser for
extracting the key fields within the Python binding fails because the base type
is (potentially) still undefined in the type library in Cyclone.  This results in a "bad
parameter" exception.

Signed-off-by: Erik Boasson <eb@ilities.com>
  • Loading branch information
eboasson committed Mar 18, 2024
1 parent 56fe558 commit b5a4151
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cyclonedds/idl/_xt_builder.py
Expand Up @@ -406,6 +406,20 @@ def gather_types(cls, _type):

graph[my_node_name].add(scan_node_name)

if isclass(_ctype) and issubclass(_ctype, IdlStruct):
# get_extended_type_hints will not inspect the base type, which is a struct
base_type = _ctype.__base__
if base_type is None or base_type == IdlStruct:
pass
else:
print("base type!")
scan_node_name = base_type.__idl_typename__.replace('.', '::')
if scan_node_name not in graph:
graph[scan_node_name] = set()
graph_types[scan_node_name] = base_type

graph[my_node_name].add(scan_node_name)

for name, fieldtype in get_extended_type_hints(_ctype).items():
m, deep = cls._deep_gather_type(fieldtype)
plain = cls._impl_xt_is_plain(fieldtype)
Expand Down

0 comments on commit b5a4151

Please sign in to comment.