Go to the documentation of this file. 1 #ifndef GRAPH_ANALYSIS_FILTERS_REGEX_FILTER_HPP
2 #define GRAPH_ANALYSIS_FILTERS_REGEX_FILTER_HPP
4 #include "../Vertex.hpp"
7 #include <base-logging/Logging.hpp>
34 virtual std::string
getName()
const {
return "graph_analysis::filters::RegexFilter: '" +
toString() +
"'"; }
43 txt +=
"not-inverted";
48 virtual bool apply(T element)
const
54 result = regex_match(element->toString(),
mRegex);
57 result = regex_match(element->getClassName(),
mRegex);
60 throw std::runtime_error(
"graph_analysis::filters::RegexFilter unknown filter type provided");
81 virtual std::string
getName()
const;
93 virtual std::string
getName()
const;
106 virtual std::string
getName()
const;
107 virtual std::string
toString()
const;
120 #endif // GRAPH_ANALYSIS_FILTERS_REGEX_FILTER_HPP
@ CLASS
Definition: Filter.hpp:17
@ CONTENT
Definition: Filter.hpp:17
virtual bool evaluateTarget(graph_analysis::Edge::Ptr e) const
Evaluated the target of the edge.
Definition: RegexFilters.cpp:44
std::map< Type, std::string > TypeTxt
Definition: Filter.cpp:7
CombinedEdgeRegexFilter(VertexRegexFilter sourceNodeFilter, EdgeRegexFilter edgeFilter, VertexRegexFilter targetNodeFilter)
Definition: RegexFilters.cpp:18
std::string mRegexStr
Definition: RegexFilters.hpp:21
EdgeRegexFilter(const std::string ®ex=std::string(), Type type=CONTENT, bool invert=false)
Definition: RegexFilters.cpp:12
Type mType
Definition: RegexFilters.hpp:23
Filter to sort out edges.
Definition: RegexFilters.hpp:88
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
virtual std::string toString() const
Get string representation of filter.
Definition: RegexFilters.cpp:31
Definition: RegexFilters.hpp:99
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
bool mInverted
Definition: RegexFilters.hpp:24
virtual std::string getName() const
Get Name of the filter.
Definition: RegexFilters.cpp:29
virtual std::string getName() const
Definition: RegexFilters.hpp:34
Definition: RegexFilters.hpp:18
virtual std::string getName() const
Definition: RegexFilters.cpp:10
VertexRegexFilter(const std::string ®ex=std::string(), Type type=CONTENT, bool invert=false)
Definition: RegexFilters.cpp:6
virtual std::string toString() const
Definition: RegexFilters.hpp:36
virtual ~CombinedEdgeRegexFilter()
Definition: RegexFilters.cpp:27
virtual bool evaluateSource(graph_analysis::Edge::Ptr e) const
Evaluated the source vertex of the edge.
Definition: RegexFilters.cpp:39
Filter for a graph.
Definition: Filter.hpp:55
virtual std::string getName() const
Definition: RegexFilters.cpp:16
virtual bool apply(T element) const
Apply only the main filter(!) to the target object.
Definition: RegexFilters.hpp:48
Definition: EdgeContextFilter.hpp:12
Type
Filters can operator on content or class information.
Definition: Filter.hpp:17
std::regex mRegex
Definition: RegexFilters.hpp:22
Filter to sort out vertices.
Definition: RegexFilters.hpp:76
RegexFilter(const std::string ®ex, Type type, bool invert)
Definition: RegexFilters.hpp:27