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

Improve documentation of Model and ModelNode usage #55

Open
josephbirkner opened this issue Sep 21, 2023 · 1 comment
Open

Improve documentation of Model and ModelNode usage #55

josephbirkner opened this issue Sep 21, 2023 · 1 comment
Labels
docs 📖 Improvements or additions to documentation

Comments

@josephbirkner
Copy link
Member

josephbirkner commented Sep 21, 2023

Currently, it is hard to figure out how to use and extend Models and ModelNodes. This concept, as well as all existing Node types should be extensively documented (mainly in docstrings for model/nodes.h).

@josephbirkner josephbirkner added the docs 📖 Improvements or additions to documentation label Sep 21, 2023
@josephbirkner josephbirkner changed the title Improve documentation of ModelNode usage Improve documentation of Model and ModelNode usage Sep 21, 2023
@josephbirkner
Copy link
Member Author

For example, the question came up for how to iterate over the fields of an object. This would be the answer:

for (auto const& [fieldNameId, fieldValueNode] : object->fields()) {
   auto fieldNameStr = *fieldNames().resolve(fieldNameId);
   auto fieldValue = fieldValueNode->value();
   ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs 📖 Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant