Plasma Engine  2.0
Loading...
Searching...
No Matches
DocumentObjectVisitor.h
1#pragma once
2
3#include <Foundation/Strings/String.h>
4#include <Foundation/Types/Delegate.h>
5#include <ToolsFoundation/ToolsFoundationDLL.h>
6
9
11class PL_TOOLSFOUNDATION_DLL plDocumentObjectVisitor
12{
13public:
23 const plDocumentObjectManager* pManager, plStringView sChildrenProperty = "Children", plStringView sRootProperty = "Children");
24
25 using VisitorFunction = plDelegate<bool(const plDocumentObject*)>;
34 void Visit(const plDocumentObject* pObject, bool bVisitStart, VisitorFunction function);
35
36private:
37 void TraverseChildren(const plDocumentObject* pObject, plStringView sProperty, VisitorFunction& function);
38
39 const plDocumentObjectManager* m_pManager = nullptr;
40 plString m_sChildrenProperty;
41 plString m_sRootProperty;
42};
Definition DocumentObjectBase.h:11
Represents to content of a document. Every document has exactly one root object under which all objec...
Definition DocumentObjectManager.h:116
Implements visitor pattern for content of the document object manager.
Definition DocumentObjectVisitor.h:12
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A generic delegate class which supports static functions and member functions.
Definition Delegate.h:76