MCPcopy Create free account
hub / github.com/ImageEngine/cortex / addPathsWalk

Method addPathsWalk

src/IECore/PathMatcher.cpp:640–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640PathMatcher::NodePtr PathMatcher::addPathsWalk( Node *node, const Node *srcNode, bool shared, bool &added )
641{
642 shared = shared || node->refCount() > 1;
643
644 NodePtr result;
645 if( !node->terminator && srcNode->terminator )
646 {
647 added = true;
648 writable( node, result, shared )->terminator = true;
649 }
650
651 for( Node::ChildMap::const_iterator it = srcNode->children.begin(), eIt = srcNode->children.end(); it != eIt; ++it )
652 {
653 Node *srcChild = it->second.get();
654 NodePtr newChild;
655 if( Node *child = node->child( it->first ) )
656 {
657 if( child != srcChild )
658 {
659 newChild = addPathsWalk( child, srcChild, shared, added );
660 }
661 }
662 else
663 {
664 newChild = srcChild;
665 added = true; // source node can only exist if it or a descendant is a terminator
666 }
667 if( newChild )
668 {
669 writable( node, result, shared )->children[it->first] = newChild;
670 }
671 }
672
673 return result;
674}
675
676PathMatcher::NodePtr PathMatcher::addPrefixedPathsWalk( Node *node, const Node *srcNode, const NameIterator &start, const NameIterator &end, bool shared, bool &added )
677{

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected