graph_analysis
CommonFilters.hpp
Go to the documentation of this file.
1 #ifndef GRAPH_ANALYSIS_COMMON_FILTERS_HPP
2 #define GRAPH_ANALYSIS_COMMON_FILTERS_HPP
3 
4 #include "../Filter.hpp"
5 #include "EdgeContextFilter.hpp"
6 
7 namespace graph_analysis {
8 namespace filters {
9 
13 template<typename FilterObject>
14 class DenyAll : public Filter<FilterObject>
15 {
16  virtual std::string getName() const { return "graph_analysis::filter::DenyAll"; }
17  virtual bool apply(FilterObject o ) const { return true; }
18 };
19 
24 template<>
26 {
27  virtual std::string getName() const { return "graph_analysis::filter::DenyAll (Edges)"; }
28  virtual bool apply(graph_analysis::Edge::Ptr e) const { return true; }
29  virtual bool evaluateTarget(graph_analysis::Edge::Ptr e) const { return true; }
30  virtual bool evaluateSource(graph_analysis::Edge::Ptr e) const { return true; }
31 };
32 
36 template<typename FilterObject>
37 class PermitAll : public Filter<FilterObject>
38 {
39  virtual std::string getName() const { return "graph_analysis::filter::PermitAll"; }
40  virtual bool apply(FilterObject o ) const { return false; }
41 };
42 
47 template<>
49 {
50  virtual std::string getName() const { return "graph_analysis::filter::PermitAll (Edges)"; }
51  virtual bool apply(graph_analysis::Edge::Ptr e) const { return false; }
52  virtual bool evaluateTarget(graph_analysis::Edge::Ptr e) const { return false; }
53  virtual bool evaluateSource(graph_analysis::Edge::Ptr e) const { return false; }
54 };
55 
56 } // end namespace filter
57 } // end namespace graph_analysis
58 
59 #endif // GRAPH_ANALYSIS_COMMON_FILTERS_HPP
EdgeContextFilter.hpp
graph_analysis
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
graph_analysis::Edge::Ptr
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
graph_analysis::filters::PermitAll
Definition: CommonFilters.hpp:37
graph_analysis::filters::DenyAll
Definition: CommonFilters.hpp:14
graph_analysis::Filter
Filter for a graph.
Definition: Filter.hpp:55
graph_analysis::filters::EdgeContextFilter
Definition: EdgeContextFilter.hpp:12