GraphTool  1.0
Tool for analyzing and graphically visualizing code dependencies for Ericsson.
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
blue_colour_filter.h
1 #ifndef BLUE_COLOUR_FILTER_H_
2 #define BLUE_COLOUR_FILTER_H_
3 
4 #include <string>
5 
6 #include "graph_filter.h"
7 
15 template<typename GraphType>
16 class BlueColourFilter : public GraphFilter<GraphType> {
17  public:
18  typedef typename GraphType::node_value_type V_type;
19  typedef typename GraphType::edge_value_type E_type;
20  typedef typename GraphType::index_type_t index_type_t;
21 
25  GraphFilter<GraphType>("BlueFilter", "blue_colour_filter"),
26  properties_(properties) {
27  }
28 
34  return clone;
35  }
36 
38  virtual bool operator() (E_type edge) {
39  return (edge->from() != 0 ? operator()(edge->from()) : true) &&
40  (edge->to() != 0 ? operator()(edge->to()) : true);
41  }
42 
45  virtual bool operator() (V_type m) {
46  properties_.set_property(m, "colour", "blue");
47  return true;
48  }
49 
51  template<typename P1, typename P2>
52  bool operator() (std::pair<P1, P2>& m) {
53  return operator()(m.second);
54  }
55 
56  private:
57  GraphProperties<GraphType>& properties_;
58 };
59 
60 #endif
virtual bool operator()(E_type edge)
Operator used for edges, at present this will colour both source and target of the edge...
Definition: blue_colour_filter.h:38
virtual GraphFilter< GraphType > * clone()
Definition: blue_colour_filter.h:32
Forward declarations for functors.
Definition: defines.h:32
T1 * from()
Definition: dependency.h:37
Definition: graph_filter.h:15
Definition: graph_properties.h:7
Definition: swu.h:27
BlueColourFilter(GraphProperties< GraphType > &properties)
Definition: blue_colour_filter.h:24
T2 * to()
Definition: dependency.h:45
unsigned int index_type_t
The type of index used for the nodes in the graph.
Definition: grapher.h:52
Definition: blue_colour_filter.h:16