Multidimensional array of vars?

If I do what you suggest, what methods do I need to implement to get ValueTree save my custom class into file and load it from there? The class is inherited from ReferenceCountedObject.

By this I mean that ReferenceCountedObject seems to be inherited from var class, which in turn has getBinaryData() and writeToStream(), but neither of them are virtual methods so I’m not sure what’s going on there.

EDIT:
I found an old thread asking a similar question and what Jules answered to it:

Jules said that he does things so that ValueTree’s don’t have any ReferenceCountedObjects in them, but plain old data which can be saved directly to a file. This sounds like it would create an issue with the Undo functionality later on, if my own class with custom data isn’t part of that tree.

EDIT:
Maybe ValueTreeSynchroniser could be used to achieve this? If I would use std::vectors for the data internally inside my ReferenceCountedObject and var (Array of ints) in the ValueTree. Then use ValueTreeSynchroniser to update any changes from ValueTree to that ReferenceCountedObject…