8000 DataType Encoding Refactor by kevinherron · Pull Request #1408 · eclipse-milo/milo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DataType Encoding Refactor #1408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 8, 2025
Merged

DataType Encoding Refactor #1408

merged 16 commits into from
Apr 8, 2025

Conversation

kevinherron
Copy link
Contributor
@kevinherron kevinherron commented Apr 8, 2025

Change summary

UaDataType

renamed UaDataType::getTypeName to UaDataType::getEncodingName

UaDecoder and implementations

signature of struct decoding methods now return UaStructuredType instead of Object

UaEncoder and implementations

signature of struct encoding methods now requires UaStructuredType instead of Object

DataTypeEncoding and implementations

modified encode and decode signatures to:

  ExtensionObject encode(EncodingContext context, UaStructuredType struct, NodeId encodingId);

  UaStructuredType decode(EncodingContext context, ExtensionObject encoded, NodeId encodingId);

DataTypeCodec

  • signature of decode now returns UaStructuredType instead of Object
  • signature of encode now requires UaStructuredType instead of Object

ExtensionObject

  • decode methods return UaStructuredType instead of Object
  • encode methods require UaStructuredType instead of Object

Legacy DataType / DataTypeDictionary

introduces BsdStructWrap 10000 per as a wrapper type that implements UaStructuredType. It's now the type returned by AbstractBsdCodec::decode and expected by AbstractBsdCodec::encode.

the end result is that the object you get from ExtensionObject::decode is now a BsdStructWrapper instead of the raw type when using legacy datatypes. The object that should be passed to ExtensionObject.encode should be a BsdStructWrapper instead of the raw type.

this matches the behavior of the new dynamic DataType support, which returns "wrapper" objects of DynamicType or JsonStruct.

@kevinherron kevinherron marked this pull request as ready for review April 8, 2025 14:35
@kevinherron kevinherron merged commit 4c029dc into dev/1.0 Apr 8, 2025
3 checks passed
@kevinherron kevinherron deleted the tasks/encoding-refactor branch April 14, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0