Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Types | Public Member Functions | List of all members
datatools::dependency_graph Class Reference

Dependency graph. More...

#include <bayeux/datatools/dependency_graph.h>

Classes

struct  cycle_detector
 Visitor for cycle detection. More...
 
struct  edge_properties_t
 
class  fvocf_visitor
 Visitor for finding dependee vertices of given category. More...
 
struct  graph_properties_t
 
struct  vertex_properties_t
 

Public Types

enum  xgv_flags { XGV_NONE = 0, XGV_WITH_EDGE_TOPIC = bit_mask::bit00, XGV_WITH_VERTEX_CATEGORY = bit_mask::bit01, XGV_WITH_VERTEX_INDEX = bit_mask::bit02 }
 Export flags for Graphviz. More...
 
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, vertex_properties_t, edge_properties_t, graph_properties_t, boost::listS > graph_t
 
typedef boost::graph_traits< graph_t >::vertex_descriptor vertex_t
 
typedef boost::graph_traits< graph_t >::edge_descriptor edge_t
 
typedef boost::graph_traits< graph_t >::vertex_iterator vertex_iter_t
 
typedef boost::graph_traits< graph_t >::edge_iterator edge_iter_t
 
typedef boost::graph_traits< graph_t >::out_edge_iterator out_edge_iter_t
 
typedef boost::graph_traits< graph_t >::in_edge_iterator in_edge_iter_t
 

Public Member Functions

 dependency_graph ()
 Default constructor. More...
 
 ~dependency_graph ()
 Destructor. More...
 
bool has_vertex (const std::string &id_, const std::string &category_="") const
 Check it a vertex with given id and category. More...
 
void add_vertex (const std::string &id_, const std::string &category_)
 Add a vertex with given id and category. More...
 
void add_out_edge (const std::string &id_from_, const std::string &id_to_, const std::string &topic_)
 Add an out edge with given topic between to vertices. More...
 
bool has_out_edge (const std::string &id1_, const std::string &id2_, const std::string &topic_="") const
 Check it an edge between two vertices exists with given topic. More...
 
void reset ()
 Reset. More...
 
bool has_cycle () const
 Check if some dependency cycle is detected. More...
 
bool find_vertices_in_cycles (std::set< vertex_t > &) const
 Find vertices belonging to cycles. More...
 
std::set< std::string > find_dependees_of_category_from (const std::string &depender_id_, const std::string &category_) const
 Find all dependee vertices of a given category from a starting depender vertex. More...
 
std::set< std::string > find_dependers_of_category_from (const std::string &dependee_id_, const std::string &category_="", const std::size_t depth_=0) const
 Find all depender vertices of a given category from a starting dependee vertex. More...
 
void smart_print (std::ostream &out_) const
 Smart print. More...
 
void export_graphviz (std::ostream &out_, const uint32_t flags_=0) const
 Export graph to Graphviz dot format. More...
 
std::string get_vertex_id (const vertex_t) const
 

Detailed Description

Dependency graph.

Member Typedef Documentation

◆ edge_iter_t

typedef boost::graph_traits<graph_t>::edge_iterator datatools::dependency_graph::edge_iter_t

◆ edge_t

typedef boost::graph_traits<graph_t>::edge_descriptor datatools::dependency_graph::edge_t

◆ graph_t

typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, vertex_properties_t, edge_properties_t, graph_properties_t, boost::listS > datatools::dependency_graph::graph_t

◆ in_edge_iter_t

typedef boost::graph_traits<graph_t>::in_edge_iterator datatools::dependency_graph::in_edge_iter_t

◆ out_edge_iter_t

typedef boost::graph_traits<graph_t>::out_edge_iterator datatools::dependency_graph::out_edge_iter_t

◆ vertex_iter_t

typedef boost::graph_traits<graph_t>::vertex_iterator datatools::dependency_graph::vertex_iter_t

◆ vertex_t

typedef boost::graph_traits<graph_t>::vertex_descriptor datatools::dependency_graph::vertex_t

Member Enumeration Documentation

◆ xgv_flags

Export flags for Graphviz.

Enumerator
XGV_NONE 

No flags.

XGV_WITH_EDGE_TOPIC 

Print edge topic.

XGV_WITH_VERTEX_CATEGORY 

Print vertex category.

XGV_WITH_VERTEX_INDEX 

Print vertex index (debug)

Constructor & Destructor Documentation

◆ dependency_graph()

datatools::dependency_graph::dependency_graph ( )

Default constructor.

◆ ~dependency_graph()

datatools::dependency_graph::~dependency_graph ( )

Destructor.

Member Function Documentation

◆ add_out_edge()

void datatools::dependency_graph::add_out_edge ( const std::string &  id_from_,
const std::string &  id_to_,
const std::string &  topic_ 
)

Add an out edge with given topic between to vertices.

◆ add_vertex()

void datatools::dependency_graph::add_vertex ( const std::string &  id_,
const std::string &  category_ 
)

Add a vertex with given id and category.

◆ export_graphviz()

void datatools::dependency_graph::export_graphviz ( std::ostream &  out_,
const uint32_t  flags_ = 0 
) const

Export graph to Graphviz dot format.

◆ find_dependees_of_category_from()

std::set<std::string> datatools::dependency_graph::find_dependees_of_category_from ( const std::string &  depender_id_,
const std::string &  category_ 
) const

Find all dependee vertices of a given category from a starting depender vertex.

◆ find_dependers_of_category_from()

std::set<std::string> datatools::dependency_graph::find_dependers_of_category_from ( const std::string &  dependee_id_,
const std::string &  category_ = "",
const std::size_t  depth_ = 0 
) const

Find all depender vertices of a given category from a starting dependee vertex.

◆ find_vertices_in_cycles()

bool datatools::dependency_graph::find_vertices_in_cycles ( std::set< vertex_t > &  ) const

Find vertices belonging to cycles.

◆ get_vertex_id()

std::string datatools::dependency_graph::get_vertex_id ( const  vertex_t) const

◆ has_cycle()

bool datatools::dependency_graph::has_cycle ( ) const

Check if some dependency cycle is detected.

◆ has_out_edge()

bool datatools::dependency_graph::has_out_edge ( const std::string &  id1_,
const std::string &  id2_,
const std::string &  topic_ = "" 
) const

Check it an edge between two vertices exists with given topic.

◆ has_vertex()

bool datatools::dependency_graph::has_vertex ( const std::string &  id_,
const std::string &  category_ = "" 
) const

Check it a vertex with given id and category.

◆ reset()

void datatools::dependency_graph::reset ( )

Reset.

◆ smart_print()

void datatools::dependency_graph::smart_print ( std::ostream &  out_) const

Smart print.


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