Use pugixml for Proxy Definitions
We want to use pugixml for Proxy definitions. vtkProxyDefinitionManager shuold simply use pugi. The problem is that definitions for proxy may change in the lifetime of the process. Since pugi::xml_document
has the ownership of all data, if a vtkSMProxy
is holding on the pugi:xml_node
it was given during creation -- which it needs to to support things like "hints" -- then those nodes will become invalid.
A few options:
-
Proxy is given
pugi::xml_node
together with ashared_ptr<pugi::xml_document>
. It can hold on to the document for as long as it wants. ProxyDefinitonManager will always create a newxml_document
when definitions are updated thus leaving the old unchanged. -
ProxyDefinitionManager keeps a separate
std::shared_ptr<pugi::xml_document>
per proxy definition. When one is updated is simply creates a new one. The Proxy is given thestd::shared_ptr<pugi::xml_document>
that it can keep, if it likes since it's immutable.
I think I prefer 2.