Hi,
I have a found a problem with dynamically setting individual sequence elements. The attached file demonstates the problem, where an unrelated change in the structure's type code changes the behaviour from working as expected to not working.
Its likely that I'm not doing this correctly and its just a fluke that it works in any condition. (Note that I need to be able to set sequence elements individually - I have seen the code posted recently for setting an entire sequence.) I know there isn't any call made such as "ensure_length", because there doesn't seem to be one available in the DynamicData api.
Any advice or insight appreciated!
Mike.
Attachment | Size |
---|---|
test_case.cxx | 9.78 KB |
Hello Mike,
Thank you for sending the example code illustrating the problem. It helps a lot. I was able to reproduce the problem and as far as I can tell it is a bug in the DynamicData implememtation which seems to be related to the use of booleans.
I tried the exact same example changing the type of the 'b' members from 'boolean' to 'long' and also replacing the
set_boolean()
withset_long()
and then the program works as expected...I have created a bug for it. The id for this bug is CORE-5925 once it is resolved it should appear in the release notes.
As a side note I noticed you wrote the function
PrintComplexDynamicData
to print the contents of the DynamicData object. However there is already an operation calledprint
inDynamicData
that does almost the same thing. So you could have calledsample.print(stdout, 0)
instead ofPrintComplexDynamicData("sample", sample)
Regards,
Gerardo
Hi Gerardo,
Thanks for looking at this and also pointing out the print method. I have been using print_IDL on typecodes but didn't spot that one.
regards,
Mike.