GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
GraphFilter< GraphType > Class Template Referenceabstract

#include <graph_filter.h>

Inheritance diagram for GraphFilter< GraphType >:
Inheritance graph
[legend]

Public Types

typedef GraphType::node_value_type V_type
 
typedef GraphType::edge_value_type E_type
 

Public Member Functions

 GraphFilter (std::string filter_name="", std::string filter_type="", bool inverted=false, bool enabled=true, bool nodes=true, bool edges=true)
 
void set_inverted (bool status)
 Sets the inverted status.
 
void set_enabled (bool enabled)
 Sets enabled.
 
std::string name () const
 
std::string type () const
 
bool inverted () const
 
virtual bool enabled () const
 
virtual bool nodes () const
 The nodes property tells us whether this filter operates on nodes.
 
virtual bool edges () const
 The edgesproperty tells us whether this filter operates on nodes.
 
virtual GraphFilter< GraphType > * clone ()=0
 
virtual bool operator() (V_type m)=0
 Returns true if the given node should be included, or false if it is to be filtered out.
 
virtual bool operator() (E_type e)=0
 Returns true if the give edgen matches the filter.
 
template<typename P1 , typename P2 >
bool operator() (std::pair< P1, P2 > &m)
 

Protected Attributes

bool inverted_
 
bool enabled_
 
bool nodes_
 
bool edges_
 

Detailed Description

template<typename GraphType>
class GraphFilter< GraphType >

Class used to filter the graph. This is the base class from which additional filters can be implemented. This class simply has one method (therefore act as a functor) which returns false if this node should be filtered (ie. not added to the graph) and true otherwise.

Filters are used in conjuction with GraphActions to perform actions on a Grapher object.

Constructor & Destructor Documentation

template<typename GraphType>
GraphFilter< GraphType >::GraphFilter ( std::string  filter_name = "",
std::string  filter_type = "",
bool  inverted = false,
bool  enabled = true,
bool  nodes = true,
bool  edges = true 
)
inline

Constructor

Parameters
filter_nameName of the filter
filter_typeName of the filter type
invertedFilter is inverted

Member Function Documentation

template<typename GraphType>
virtual GraphFilter<GraphType>* GraphFilter< GraphType >::clone ( )
pure virtual

Clone method, in order to work with this polymorphic object we might need to clone it therefore it must implement the clone operation

Implemented in DiffFilter< GraphType >, DependencyDegreeFilter< GraphType >, RunBlockFilter< GraphType >, RegexFilter< GraphType >, NodeExclusionFilter< GraphType >, BlueColourFilter< GraphType >, EdgeTypeFilter< GraphType >, TrueFilter< GraphType >, and InvertFilter< GraphType >.

template<typename GraphType>
virtual bool GraphFilter< GraphType >::enabled ( ) const
inlinevirtual

Whether or not this filter is enabled, meaning whether it should have any impact on the graph or not

Reimplemented in DiffFilter< GraphType >, and RunBlockFilter< GraphType >.

template<typename GraphType>
bool GraphFilter< GraphType >::inverted ( ) const
inline

Whether or not this filter is inverted or not, inverted means that the filter will return the opposite result to what it otherwise does (ie. true if the node or edge does NOT match the filter).

template<typename GraphType>
std::string GraphFilter< GraphType >::name ( ) const
inline

Returns the name/ID of the filter

Returns
Name/ID of the filter
template<typename GraphType>
template<typename P1 , typename P2 >
bool GraphFilter< GraphType >::operator() ( std::pair< P1, P2 > &  m)
inline

Operator used for STL to handle generic pairs, in our case Grapher stores pairs for both edges and nodes so this allows this filter to be used with the STL algorithms for both edges and nodes. operator() polymorphism handles figuring out which operator() to use.

template<typename GraphType>
std::string GraphFilter< GraphType >::type ( ) const
inline

Returns the type name of the filter

Returns
Type name of the filter

The documentation for this class was generated from the following file: