XII Release 0.1.0
Loading...
Searching...
No Matches
xiiAbstractObjectGraph Class Reference

Public Types

using FilterFunction = xiiDelegate<bool(const xiiAbstractObjectNode*, const xiiAbstractObjectNode::Property*)>
 

Public Member Functions

void Clear ()
 
xiiAbstractObjectNodeClone (xiiAbstractObjectGraph &ref_cloneTarget, const xiiAbstractObjectNode *pRootNode=nullptr, FilterFunction filter=FilterFunction()) const
 
xiiStringView RegisterString (xiiStringView sString)
 
const xiiAbstractObjectNodeGetNode (const xiiUuid &guid) const
 
xiiAbstractObjectNodeGetNode (const xiiUuid &guid)
 
const xiiAbstractObjectNodeGetNodeByName (xiiStringView sName) const
 
xiiAbstractObjectNodeGetNodeByName (xiiStringView sName)
 
xiiAbstractObjectNodeAddNode (const xiiUuid &guid, xiiStringView sType, xiiUInt32 uiTypeVersion, xiiStringView sNodeName={})
 
void RemoveNode (const xiiUuid &guid)
 
const xiiMap< xiiUuid, xiiAbstractObjectNode * > & GetAllNodes () const
 
xiiMap< xiiUuid, xiiAbstractObjectNode * > & GetAllNodes ()
 
void ReMapNodeGuids (const xiiUuid &seedGuid, bool bRemapInverse=false)
 Remaps all node guids by adding the given seed, or if bRemapInverse is true, by subtracting it/ This is mostly used to remap prefab instance graphs to their prefab template graph.
 
void ReMapNodeGuidsToMatchGraph (xiiAbstractObjectNode *pRoot, const xiiAbstractObjectGraph &rhsGraph, const xiiAbstractObjectNode *pRhsRoot)
 Tries to remap the guids of this graph to those in rhsGraph by walking in both down the hierarchy, starting at root and rhsRoot.
 
void FindTransitiveHull (const xiiUuid &rootGuid, xiiSet< xiiUuid > &out_reachableNodes) const
 Finds everything accessible by the given root node.
 
void PruneGraph (const xiiUuid &rootGuid)
 Deletes everything not accessible by the given root node.
 
void ModifyNodeViaNativeCounterpart (xiiAbstractObjectNode *pRootNode, xiiDelegate< void(void *, const xiiRTTI *)> callback)
 Allows for a given node to be modified as a native object. Once the callback exits any changes to the sub-hierarchy of the given root node will be written back to the node objects.
 
xiiAbstractObjectNodeCopyNodeIntoGraph (const xiiAbstractObjectNode *pNode)
 Allows to copy a node from another graph into this graph.
 
xiiAbstractObjectNodeCopyNodeIntoGraph (const xiiAbstractObjectNode *pNode, FilterFunction &ref_filter)
 
void CreateDiffWithBaseGraph (const xiiAbstractObjectGraph &base, xiiDeque< xiiAbstractGraphDiffOperation > &out_diffResult) const
 
void ApplyDiff (xiiDeque< xiiAbstractGraphDiffOperation > &ref_diff)
 
void MergeDiffs (const xiiDeque< xiiAbstractGraphDiffOperation > &lhs, const xiiDeque< xiiAbstractGraphDiffOperation > &rhs, xiiDeque< xiiAbstractGraphDiffOperation > &ref_out) const
 

Member Function Documentation

◆ ReMapNodeGuidsToMatchGraph()

void xiiAbstractObjectGraph::ReMapNodeGuidsToMatchGraph ( xiiAbstractObjectNode * pRoot,
const xiiAbstractObjectGraph & rhsGraph,
const xiiAbstractObjectNode * pRhsRoot )

Tries to remap the guids of this graph to those in rhsGraph by walking in both down the hierarchy, starting at root and rhsRoot.

Note that in case of array properties the remapping assumes element indices to be equal on both sides which will cause all moves inside the arrays to be lost as there is no way of recovering this information without an equality criteria. This function is mostly used to remap a graph from a native object to a graph from xiiDocumentObjects to allow applying native side changes to the original xiiDocumentObject hierarchy using diffs.


The documentation for this class was generated from the following files: