Skip to content
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

ambiguous types #11

Open
thomvet opened this issue Dec 18, 2023 · 1 comment
Open

ambiguous types #11

thomvet opened this issue Dec 18, 2023 · 1 comment

Comments

@thomvet
Copy link
Collaborator

thomvet commented Dec 18, 2023

Currently, there are a number of ambiguous types (several UA types have the same julia type), namely:

types_ambiguous_ignorelist = [
    :UA_Duration, #Float64
    :UA_ByteString, #UA_String
    :UA_XmlElement, #UA_String
    :UA_LocaleId, #UA_String
    :UA_DateTime, #Int64
    :UA_UtcTime, #Int64
    :UA_StatusCode, #UInt32
]

I am wondering whether this is a problem when we are defining UA_XXX_delete methods that look up the correct UA type within UA_TYPES_PTRS based on the julia type.

For the string types, it would for example be quite easy to make them distinct (just copy the UA_String struct definition); for the number types, it would be slightly more involved, but I think it could in principle be done using AbstractNumbers.jl.

@martinkosch
Copy link
Owner

Yes, this currently definitely leads to a problem as the user is required to add the correct type_ptrargument to the functions. AbstractNumbers.jl indeed looks promising for a nice solution.

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

No branches or pull requests

2 participants