Plasma Engine  2.0
Loading...
Searching...
No Matches
plDocumentObjectVisitor Class Reference

Implements visitor pattern for content of the document object manager. More...

#include <DocumentObjectVisitor.h>

Public Types

using VisitorFunction = plDelegate<bool(const plDocumentObject*)>
 

Public Member Functions

 plDocumentObjectVisitor (const plDocumentObjectManager *pManager, plStringView sChildrenProperty="Children", plStringView sRootProperty="Children")
 Constructor.
 
void Visit (const plDocumentObject *pObject, bool bVisitStart, VisitorFunction function)
 Executes depth first traversal starting at the given node.
 

Detailed Description

Implements visitor pattern for content of the document object manager.

Constructor & Destructor Documentation

◆ plDocumentObjectVisitor()

plDocumentObjectVisitor::plDocumentObjectVisitor ( const plDocumentObjectManager * pManager,
plStringView sChildrenProperty = "Children",
plStringView sRootProperty = "Children" )

Constructor.

Parameters
pManagerManager that will be iterated through.
szChildrenPropertyName of the property that is used for finding children on an object.
szRootPropertySame as szChildrenProperty, but for the root object of the document.

Member Function Documentation

◆ Visit()

void plDocumentObjectVisitor::Visit ( const plDocumentObject * pObject,
bool bVisitStart,
VisitorFunction function )

Executes depth first traversal starting at the given node.

Parameters
pObjectObject to start traversal at.
bVisitStartIf true, function will be executed for the start object as well.
functionFunctions executed for each visited object. Should true if the object's children should be traversed.

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