Well you can certainly stick all that data in one… Not sure whether I’d call it a database though, I don’t know if they’ll scale very well to millions of records!
…no, it’s not possible to do that, otherwise you could get all sorts of circular dependencies and reference counting problems. It’s like XML where you could either insert multiple copies of the source object, or do what you’d do in a database, and have some kind of index key which you look up in another list.
Not really sure how you’re imagining you’d create a weak reference. It’s a fundamental property of valuetrees that they can only have one parent - you can have multiple shared pointers to the same valuetree from your own data structures, but not from a parent valuetree.
That’s what I was wondering - whether a ‘property’ of a ValueTree could be a weak pointer to another ValueTree. Avoiding the circular reference maybe.
But I hadn’t really looked at it - you mentioned circular references, and I thought I remembered you adding weak references somewhere. No problem - I’ll use an ID property.