|
graph_analysis
|
#include <Filter.hpp>

Public Types | |
| typedef Filter< FilterObject > | FilterType |
| typedef shared_ptr< FilterType > | Ptr |
| typedef std::vector< FilterType::Ptr > | FilterList |
Public Member Functions | |
| virtual | ~Filter () |
| virtual std::string | getName () const |
| Get Name of the filter. More... | |
| virtual std::string | toString () const |
| Get string representation of filter. More... | |
| int | replace (FilterType::Ptr filter, int position=-1) |
| void | clear () |
| int | add (FilterType::Ptr filter, int position=-1) |
| void | removeAt (int position) |
| bool | matches (FilterObject o, filters::Operator op=filters::OR) const |
| Apply all filters, i.e. root filter and children to the filter object, i.e., test whether filter matches the filter object. More... | |
| virtual bool | apply (FilterObject o) const |
| Apply only the main filter(!) to the target object. More... | |
Static Public Member Functions | |
| static Ptr | Null () |
Protected Attributes | |
| FilterList | mFilters |
Filter for a graph.
Allow definition of a filter per object type. Object type should inherit from Vertex or Edge
This filter class allows bagging of multiple individual filters into a single filter object
class SpecialVertexFilter : public Filter< Vertex::Ptr >
{
public:
virtual std::string getName() const { return "SpecialVertexFilter"; }
virtual bool apply(Vertex::Ptr element) const
{
return element->getClassName() == "SpecialVertex";
}
};
BaseGraph::Ptr graph = BaseGraph::getInstance();
...
SubGraph::Ptr subGraph = BaseGraph::getSubGraph(graph);
Filter< Vertex::Ptr >::Ptr vertexFilter(new SpecialVertexFilter());
Filter< Edge::Ptr >::Ptr edgeFilter(new filters::PermitAll< Edge::Ptr >());
subGraph->applyFilters(vertexFilter, edgeFilter);
// Convert to base graph when you want to use the graph with any of the
// available algorithms
BaseGraph::ptr filteredGraph = subGraph->toBaseGraph(); | typedef std::vector< FilterType::Ptr > graph_analysis::Filter< FilterObject >::FilterList |
| typedef Filter<FilterObject> graph_analysis::Filter< FilterObject >::FilterType |
| typedef shared_ptr<FilterType> graph_analysis::Filter< FilterObject >::Ptr |
|
inlinevirtual |
Deconstructor
|
inline |
Add a filter
| filter | Filter to add |
| position | Position of the filter |
|
inlinevirtual |
Apply only the main filter(!) to the target object.
| o | Filter object, i.e. target object to apply the filter on |
Reimplemented in graph_analysis::filters::RegexFilter< T >, graph_analysis::filters::RegexFilter< ::graph_analysis::Vertex::Ptr >, and graph_analysis::filters::RegexFilter< ::graph_analysis::Edge::Ptr >.
|
inline |
Clears the list of additional filters that have been added to this filter
|
inlinevirtual |
Get Name of the filter.
Reimplemented in graph_analysis::filters::RegexFilter< ::graph_analysis::Edge::Ptr >, and graph_analysis::filters::RegexFilter< ::graph_analysis::Vertex::Ptr >.
|
inline |
Apply all filters, i.e. root filter and children to the filter object, i.e., test whether filter matches the filter object.
| o | FilterObject, i.e. target that requires evaluation |
| op | Chain the subfilter dis/con-junctively using available operators OR and AND |
|
inlinestatic |
Return Null Filter
|
inline |
|
inline |
Replace a filter at a certain position in the internally kept filter list This might be needed to update a filter
| filter | Filter to replace the existing one with |
| position | Position of the filter that should be replaced, if position -1 is given the filter is added without replacing another |
| std::out_of_range | if the position does not exist |
|
inlinevirtual |
Get string representation of filter.
Reimplemented in graph_analysis::filters::RegexFilter< ::graph_analysis::Edge::Ptr >, and graph_analysis::filters::RegexFilter< ::graph_analysis::Vertex::Ptr >.
|
protected |
1.8.17