-
Notifications
You must be signed in to change notification settings - Fork 15
DataTree and utility classes #74
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add DataTree System with Query, Schema, and Cached Values
This PR introduces a new powerful hierarchical data model system to YUP, centered around the DataTree class. This system provides a robust foundation for storing and manipulating structured data with transactions, validation, and efficient querying.
Core Components
DataTree: A transactional hierarchical data structure that replaces traditional ValueTree with enhanced performance, safety, and usability
DataTreeQuery: A sophisticated query engine with both fluent API and XPath-like syntax for extracting data
DataTreeSchema: JSON Schema-based validation for DataTree structures
CachedValue/AtomicCachedValue: Reactive property wrappers that update automatically when data changes
DataTreeObjectList: Collection management for binding C++ objects to DataTree nodes
Key Features
Transactional Operations: All changes are performed through transactions for atomicity
Schema Validation: Define constraints, defaults, and validation rules using JSON Schema
Reactive Properties: Cached values automatically update when the underlying data changes
Thread Safety: Atomic cached values for concurrent access
Efficient Querying: Powerful query system for navigating, filtering, and transforming data
Object Binding: Synchronize C++ objects with the data model
Documentation
Added a comprehensive tutorial for the DataTree system that explains:
Other Changes
This new data model provides a foundation for building more complex state management, configurations, and object hierarchies in YUP applications.