RDFAnalysis
0.1.1
Physics analysis with ROOT::RDataFrame
|
Class to build Boost Graph Library graphs from a recursive tree structure. More...
#include <BoostGraphBuilder.h>
Data Structures | |
struct | Vertex |
The vertex struct. More... | |
Public Types | |
using | input_node_t = InputNode |
The input node type. More... | |
using | vertex_info_t = VertexInfo |
The vertex info type. More... | |
using | child_itr_t = ChildItr |
The child iterator type. More... | |
using | graph_t = boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, Vertex > |
The BGL graph type. More... | |
using | vert_desc_t = typename boost::graph_traits< graph_t >::vertex_descriptor |
The BGL vertex type. More... | |
using | prop_map_t = typename boost::property_map< graph_t, vertex_info_t Vertex::* >::type |
The BGL property map type. More... | |
Public Member Functions | |
BoostGraphBuilder (std::function< ChildItr(InputNode)> childBegin, std::function< ChildItr(InputNode)> childEnd) | |
Create the builder. More... | |
virtual | ~BoostGraphBuilder ()=0 |
graph_t | buildGraph (InputNode root) |
Build the graph. More... | |
Protected Types | |
enum | NodeDecision { Write, Skip, Terminate } |
Enum to describe what should be done with a node. More... | |
Protected Member Functions | |
virtual VertexInfo | info (InputNode input)=0 |
Create a vertex info from an input node. More... | |
virtual NodeDecision | processNode (InputNode input) |
Choose whether or not to add a node to a graph. More... | |
void | addToGraph (InputNode input, const vert_desc_t &parent, graph_t &graph) |
Add a node into the graph. More... | |
Protected Attributes | |
std::function< ChildItr(InputNode)> | m_childBegin |
Get the start of a node's children. More... | |
std::function< ChildItr(InputNode)> | m_childEnd |
Get the end of a node's children. More... | |
Class to build Boost Graph Library graphs from a recursive tree structure.
InputNode | The type of the nodes in the tree |
VertexInfo | The type of info to attach to each vertex. Must be default constructible and copy constructible |
ChildItr | The type of iterator used to iterate over child nodes |
Right now this class only allows for customising the vertices of the ouptut graph. If necessary it could be extended to write extra information to the edges.
using child_itr_t = ChildItr |
The child iterator type.
The BGL graph type.
using input_node_t = InputNode |
The input node type.
using prop_map_t = typename boost::property_map<graph_t, vertex_info_t Vertex::*>::type |
The BGL property map type.
using vert_desc_t = typename boost::graph_traits<graph_t>::vertex_descriptor |
The BGL vertex type.
using vertex_info_t = VertexInfo |
The vertex info type.
|
strongprotected |
BoostGraphBuilder | ( | std::function< ChildItr(InputNode)> | childBegin, |
std::function< ChildItr(InputNode)> | childEnd | ||
) |
Create the builder.
childBegin | Function to get the start of a node's children |
childEnd | Function to get the end of a node's children |
|
pure virtual |
|
protected |
Add a node into the graph.
graph_t buildGraph | ( | InputNode | root | ) |
Build the graph.
root | The root node of the input tree. |
|
protectedpure virtual |
Create a vertex info from an input node.
|
protectedvirtual |
Choose whether or not to add a node to a graph.
|
protected |
Get the start of a node's children.
|
protected |
Get the end of a node's children.