forked from CoatiSoftware/Sourcetrail
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeTypeSet.h
More file actions
57 lines (39 loc) · 1.47 KB
/
Copy pathNodeTypeSet.h
File metadata and controls
57 lines (39 loc) · 1.47 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
53
54
55
56
57
#ifndef NODE_TYPE_SET_H
#define NODE_TYPE_SET_H
#include <functional>
#include <vector>
#include "types.h"
class NodeType;
class NodeTypeSet
{
public:
static NodeTypeSet all();
static NodeTypeSet none();
NodeTypeSet();
NodeTypeSet(const NodeType& type);
bool operator==(const NodeTypeSet& other) const;
bool operator!=(const NodeTypeSet& other) const;
std::vector<NodeType> getNodeTypes() const;
void invert();
NodeTypeSet getInverse() const;
void add(const NodeTypeSet& typeSet);
NodeTypeSet getWithAdded(const NodeTypeSet& typeSet) const;
void remove(const NodeTypeSet& typeSet);
NodeTypeSet getWithRemoved(const NodeTypeSet& typeSet) const;
void keepMatching(const std::function<bool(const NodeType&)>& matcher);
NodeTypeSet getWithMatchingKept(const std::function<bool(const NodeType&)>& matcher) const;
void removeMatching(const std::function<bool(const NodeType&)>& matcher);
NodeTypeSet getWithMatchingRemoved(const std::function<bool(const NodeType&)>& matcher) const;
bool isEmpty() const;
bool contains(const NodeType& type) const;
bool containsMatching(const std::function<bool(const NodeType&)>& matcher) const;
bool intersectsWith(const NodeTypeSet& typeSet) const;
std::vector<Id> getNodeTypeIds() const;
private:
typedef unsigned long int MaskType;
NodeTypeSet(MaskType typeMask);
static MaskType nodeTypeToMask(const NodeType& nodeType);
static const std::vector<NodeType> s_allNodeTypes;
MaskType m_nodeTypeMask;
};
#endif // NODE_TYPE_SET_H