1 #ifndef NODE_EXCLUSION_FILTER_H_
2 #define NODE_EXCLUSION_FILTER_H_
9 #include "graph_filter.h"
16 template<
typename GraphType>
23 typedef typename std::set<V_type, V_CompareFunctor> ExcludedNodeSet;
24 typedef typename ExcludedNodeSet::iterator iterator;
25 typedef typename ExcludedNodeSet::const_iterator const_iterator;
32 GraphFilter<GraphType>(filter_name,
"node_exclusion_filter",
false,
true,
true,
false), excluded_nodes_(nodes) {
43 excluded_nodes_.insert(excluded);
48 return excluded_nodes_;
52 iterator
begin() {
return excluded_nodes_.begin(); }
55 iterator
end() {
return excluded_nodes_.end(); }
59 excluded_nodes_.erase(excluded);
64 excluded_nodes_.clear();
69 return !(this->inverted_);
75 typename ExcludedNodeSet::iterator res = excluded_nodes_.find(m);
76 if(res != excluded_nodes_.end() && !this->inverted_) {
78 }
else if(res == excluded_nodes_.end() && this->inverted_) {
86 template<
typename P1,
typename P2>
92 ExcludedNodeSet excluded_nodes_;
void clear_filter()
clears the set of filtered nodes
Definition: node_exclusion_filter.h:63
Definition: node_exclusion_filter.h:17
Functor for comparing names between SWUs.
Definition: defines.h:61
Forward declarations for functors.
Definition: defines.h:32
ExcludedNodeSet & excluded_nodes()
Retrieve the current set of excluded nodes.
Definition: node_exclusion_filter.h:47
virtual GraphFilter< GraphType > * clone()
Clone the filter.
Definition: node_exclusion_filter.h:36
iterator begin()
Returns an iterator to the beginning of the excluded nodes set.
Definition: node_exclusion_filter.h:52
Definition: graph_filter.h:15
iterator end()
Returns an iterator to the end of the excluded nodes set.
Definition: node_exclusion_filter.h:55
virtual bool nodes() const
The nodes property tells us whether this filter operates on nodes.
Definition: graph_filter.h:80
void remove_exclusion(V_type excluded)
Removes a node from the exclusion list.
Definition: node_exclusion_filter.h:58
virtual bool operator()(E_type edge)
No action taken on edges.
Definition: node_exclusion_filter.h:68
void add_exclusion(V_type excluded)
Adds a node to the exclusion list.
Definition: node_exclusion_filter.h:42
unsigned int index_type_t
The type of index used for the nodes in the graph.
Definition: grapher.h:52