-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDependencyGraphTraverser.h
More file actions
executable file
·52 lines (36 loc) · 1.4 KB
/
Copy pathDependencyGraphTraverser.h
File metadata and controls
executable file
·52 lines (36 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2006-12 HumaNature Studios Inc.
#ifndef __DEPENDENCYGRAPHTRAVERSER_H__
#define __DEPENDENCYGRAPHTRAVERSER_H__
#include "Event/EventDispatcher.h"
#include "Math/Percentage.h"
#include "DependencyGraphNode.h"
namespace core {
class DependencyGraphTraverser
: public EventDispatcher
{
public:
static const CompactString GRAPH_COMPLETE;
class ICallback
{
protected:
DependencyGraphTraverser* mTraverser;
virtual ~ICallback() {};
virtual void traverseNode(DependencyGraphNode* node) = 0;
friend DependencyGraphTraverser;
};
void initialize(const DependencyGraphNode::List& dependencies, ICallback* callback);
void traverse();
void clearDependecy(DependencyGraphNode* dependency);
protected:
DependencyGraphNode::List mDependencies;
DependencyGraphNode::List mActiveDependencies;
DependencyGraphNode::List mClearedDependencies;
Percentage mProgress;
ICallback* mCallback;
// TODO - optimize these later if needed
bool hasNoDependencies(DependencyGraphNode* dependency);
bool isDependencyActive(DependencyGraphNode* dependency);
bool isDependencyCleared(DependencyGraphNode* dependency);
};
} // namespace core
#endif // __DEPENDENCYGRAPHTRAVERSER_H__