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() +
"'"; }
38 std::string txt = mRegexStr +
"/" +
TypeTxt[
mType] +
"/";
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 Filter for a graph.
Definition: Filter.hpp:55
Definition: Filter.hpp:17
RegexFilter(const std::string ®ex, Type type, bool invert)
Definition: RegexFilters.hpp:27
std::string mRegexStr
Definition: RegexFilters.hpp:21
std::map< Type, std::string > TypeTxt
Definition: Filter.cpp:7
Type mType
Definition: RegexFilters.hpp:23
Filter to sort out vertices.
Definition: RegexFilters.hpp:76
shared_ptr< Edge > Ptr
Definition: Edge.hpp:21
Definition: Filter.hpp:17
Filter to sort out edges.
Definition: RegexFilters.hpp:88
Definition: EdgeContextFilter.hpp:12
bool mInverted
Definition: RegexFilters.hpp:24
virtual std::string getName() const
Get Name of the filter.
Definition: RegexFilters.hpp:34
Main namespace of the graph analysis library.
Definition: BFS.cpp:3
virtual std::string toString() const
Get string representation of filter.
Definition: RegexFilters.hpp:36
Definition: RegexFilters.hpp:99
virtual bool apply(T element) const
Apply only the main filter(!) to the target object.
Definition: RegexFilters.hpp:48
Definition: RegexFilters.hpp:18
std::regex mRegex
Definition: RegexFilters.hpp:22
Type
Filters can operator on content or class information.
Definition: Filter.hpp:17