Extends ParamNode:
- Each node can have multiple children with the same name
- Nodes are stored in the loading order
- ParamNode can be created from Javascript objects.
- Guarantees that attributes are placed first
The intention is to be able to load GUI XML files into ParamNode, anticipating D3823.
Other changes:
- To support the above, std::vector is used in place of std::map and the node name is moved to a member. This is likely to be equivalent or faster in random access efficiency, given that there are generally few children to a paramnode.
- Some implementation details are moved to a friend function to make incremental recompilation faster & hide them from the interface.
- Some streamlining in ApplyLayer to make the control flow more obvious
- Split some functions
- Allow overwriting values when using merge="".
The slowdown from unordered_map counting children in ApplyLayer is not significant compared to the gains in D3834 & this remains very fast overall.
TODO:
- JS attribute parsing doesn't guarantee that they're put first.
TODO after the patch:
- Move the ParamNode header to source/ps/
- Make HandleTokens more efficient
- Would be good to implement more stuff in JS.
- Would be good to allow loading XML without 'applying' it.