-
Notifications
You must be signed in to change notification settings - Fork 14
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
Zivid 8878 support nested data model types #293
base: master
Are you sure you want to change the base?
Conversation
TypeName returns the name of the Python type that represents a data model node. For a nested datamodel this is the wrapped class of the nested datamodel.
Nested datamodels are stored within the datamodel frontend as instances of the frontend of the nested datamodel model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. Would be easier to review with an example of nested datamodel type in python generated code :)
|
||
std::array<char, prefixLength + nameLength + 1> result{ '\0' }; | ||
|
||
// TODO: Switch to std::copy_n when we can switch to C++20 and drop support for GCC 9. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: maybe mention that std::copy
is not used because it is not constexpr
before C++20?
datamodel_name = child.underlying_zivid_class.value_type.split(".")[-1] | ||
datamodel_name_snake = _to_snake_case(datamodel_name) | ||
child.is_nested_datamodel = True | ||
datamodel_snake_case = _to_snake_case(datamodel_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datamodel_name_snake
and datamodel_snake_case
are the same thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
This PR updates the datamodel wrapper and frontend generator to support nested datamodels.
It won't build yet due to lacking
IsDataModelRoot
trait