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

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

#include <DocumentObjectVisitor.h>

Public Types

using VisitorFunction = xiiDelegate<bool(const xiiDocumentObject*)>
 

Public Member Functions

 xiiDocumentObjectVisitor (const xiiDocumentObjectManager *pManager, xiiStringView sChildrenProperty="Children", xiiStringView sRootProperty="Children")
 Constructor.
 
void Visit (const xiiDocumentObject *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

◆ xiiDocumentObjectVisitor()

xiiDocumentObjectVisitor::xiiDocumentObjectVisitor ( const xiiDocumentObjectManager * pManager,
xiiStringView sChildrenProperty = "Children",
xiiStringView 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 xiiDocumentObjectVisitor::Visit ( const xiiDocumentObject * 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: