Hedgehog  0.0.0
A library to generate hybrid pipeline workflow systems
hh::DotPrinter Class Reference

Printer to produce a dot representation of the current state of the graph. More...

#include "dot_printer.h"

Inheritance diagram for hh::DotPrinter:
Inheritance graph
Collaboration diagram for hh::DotPrinter:
Collaboration graph

Public Member Functions

 DotPrinter (std::filesystem::path const &dotFilePath, ColorScheme colorScheme, StructureOptions structureOptions, DebugOptions debugOptions, core::CoreNode *graph)
 DotPrinter constructor, opens the file for writing. More...
 
 ~DotPrinter () override
 Destructor, close the file.
 
void printNodeInformation (core::CoreNode *node) final
 Print node main information. More...
 
void printGraphHeader (core::CoreNode const *node) final
 Print header for the graph. More...
 
void printClusterHeader (core::CoreNode const *clusterNode) final
 Print the header of a cluster. More...
 
void printClusterFooter () final
 Print the footer of a task cluster.
 
void printGraphFooter (core::CoreNode const *graph) final
 Print the graph footer. More...
 
void printClusterEdge (core::CoreNode const *clusterNode) final
 Print the inside edges of a cluster for a task. More...
 
void printExecutionPipelineHeader (core::CoreNode *epNode, core::CoreNode *switchNode) override
 Print the execution pipeline header. More...
 
void printExecutionPipelineFooter () override
 Print the footer for the execution pipeline.
 
void printEdgeSwitchGraphs (core::CoreNode *to, std::string const &idSwitch, std::string_view const &edgeType, size_t const &queueSize, size_t const &maxQueueSize, bool isMemoryManaged) override
 Print an edge between the switch and a graph's input node. More...
 
void printEdge (core::CoreNode const *from, core::CoreNode const *to, std::string_view const &edgeType, size_t const &queueSize, size_t const &maxQueueSize, bool isMemoryManaged) final
 Create an edge between from and to. More...
 
- Public Member Functions inherited from hh::AbstractPrinter
 AbstractPrinter ()=default
 Default constructor.
 
virtual ~AbstractPrinter ()=default
 Default destructor.
 
bool hasNotBeenVisited (core::CoreNode const *node)
 Accessor to check if a node has been visited by the printer. More...
 

Private Member Functions

std::string getNodeInformation (core::CoreNode *node)
 Extract and create node information. More...
 
std::string getRGBFromRange (uint64_t const &val, uint64_t const &min, uint64_t const &range)
 Return a RGB color for a value knowing the minimum value and the range, blue least, red highest. More...
 
std::string getExecRGB (uint64_t val)
 Get the rgb color for the execution time value. More...
 
std::string getWaitRGB (uint64_t val)
 Get the rgb color for the wait time value. More...
 
std::string durationPrinter (uint64_t duration)
 Print a duration with the good unit. More...
 

Private Attributes

std::vector< std::string > edges_ = {}
 List of gathered edges definition.
 
std::ofstream outputFile_ = {}
 Output file stream.
 
ColorScheme colorScheme_ = {}
 Color scheme chosen.
 
StructureOptions structureOptions_ = {}
 Structure options chosen.
 
DebugOptions debugOptions_ = {}
 Debug option chosen.
 
uint64_t maxExecutionTime_ = {}
 Maximum execution time measured in all inside graph's nodes.
 
uint64_t minExecutionTime_ = {}
 Minimum execution time measured in all inside graph's nodes.
 
uint64_t rangeExecutionTime_ = {}
 Difference between maximum and minimum execution time.
 
uint64_t maxWaitTime_ = {}
 Maximum wait time measured in all inside graph's nodes.
 
uint64_t minWaitTime_ = {}
 Minimum wait time measured in all inside graph's nodes.
 
uint64_t rangeWaitTime_ = {}
 Difference between maximum and minimum wait time.
 
uint64_t graphExecutionDuration_ = {}
 Execution duration.
 

Detailed Description

Printer to produce a dot representation of the current state of the graph.

https://www.graphviz.org/doc/info/lang.html

Definition at line 59 of file dot_printer.h.

Constructor & Destructor Documentation

◆ DotPrinter()

hh::DotPrinter::DotPrinter ( std::filesystem::path const &  dotFilePath,
ColorScheme  colorScheme,
StructureOptions  structureOptions,
DebugOptions  debugOptions,
core::CoreNode graph 
)
inlineexplicit

DotPrinter constructor, opens the file for writing.

Parameters
dotFilePathFile's path to store the dot file
colorSchemeColor scheme chosen
structureOptionsStructure option chosen
debugOptionsDebug option chosen
graphGraph to visit and create dot file

Definition at line 84 of file dot_printer.h.

Member Function Documentation

◆ durationPrinter()

std::string hh::DotPrinter::durationPrinter ( uint64_t  duration)
inlineprivate

Print a duration with the good unit.

Parameters
durationDuration to print
Returns
std::string with the duration and the unit

Definition at line 561 of file dot_printer.h.

◆ getExecRGB()

std::string hh::DotPrinter::getExecRGB ( uint64_t  val)
inlineprivate

Get the rgb color for the execution time value.

Parameters
valExecution value to get the RGB color
Returns
RGB color for val

Definition at line 547 of file dot_printer.h.

◆ getNodeInformation()

std::string hh::DotPrinter::getNodeInformation ( core::CoreNode node)
inlineprivate

Extract and create node information.

Parameters
nodeNode to exploit
Returns
std::string with node information

Definition at line 393 of file dot_printer.h.

Here is the call graph for this function:

◆ getRGBFromRange()

std::string hh::DotPrinter::getRGBFromRange ( uint64_t const &  val,
uint64_t const &  min,
uint64_t const &  range 
)
inlineprivate

Return a RGB color for a value knowing the minimum value and the range, blue least, red highest.

Parameters
valValue to get the color
minMinimum value
rangeRange value
Returns
RGB color associated with the value

Definition at line 529 of file dot_printer.h.

◆ getWaitRGB()

std::string hh::DotPrinter::getWaitRGB ( uint64_t  val)
inlineprivate

Get the rgb color for the wait time value.

Parameters
valExecution value to get the RGB color
Returns
RGB color for val

Definition at line 554 of file dot_printer.h.

◆ printClusterEdge()

void hh::DotPrinter::printClusterEdge ( core::CoreNode const *  clusterNode)
inlinefinalvirtual

Print the inside edges of a cluster for a task.

Parameters
clusterNodeTask part of a cluster

Implements hh::AbstractPrinter.

Definition at line 218 of file dot_printer.h.

◆ printClusterHeader()

void hh::DotPrinter::printClusterHeader ( core::CoreNode const *  clusterNode)
inlinefinalvirtual

Print the header of a cluster.

Parameters
clusterNodeCluster main node

Implements hh::AbstractPrinter.

Definition at line 181 of file dot_printer.h.

◆ printEdge()

void hh::DotPrinter::printEdge ( core::CoreNode const *  from,
core::CoreNode const *  to,
std::string_view const &  edgeType,
size_t const &  queueSize,
size_t const &  maxQueueSize,
bool  isMemoryManaged 
)
inlinefinalvirtual

Create an edge between from and to.

Parameters
fromEdge origin node
toEdge destination node
edgeTypeEdge type
queueSizeCurrent queue size
maxQueueSizeCurrent maximum queue size
isMemoryManagedFlag to determine if the edge data is memory managed

Implements hh::AbstractPrinter.

Definition at line 314 of file dot_printer.h.

◆ printEdgeSwitchGraphs()

void hh::DotPrinter::printEdgeSwitchGraphs ( core::CoreNode to,
std::string const &  idSwitch,
std::string_view const &  edgeType,
size_t const &  queueSize,
size_t const &  maxQueueSize,
bool  isMemoryManaged 
)
inlineoverridevirtual

Print an edge between the switch and a graph's input node.

Parameters
toGraph's input node
idSwitchSwitch id
edgeTypeEdge's type
queueSizeCurrent queue size
maxQueueSizeCurrent max queue size
isMemoryManagedFlag to tag if the data is memory managed

Implements hh::AbstractPrinter.

Definition at line 254 of file dot_printer.h.

Here is the call graph for this function:

◆ printExecutionPipelineHeader()

void hh::DotPrinter::printExecutionPipelineHeader ( core::CoreNode epNode,
core::CoreNode switchNode 
)
inlineoverridevirtual

Print the execution pipeline header.

Parameters
epNodeExecution pipeline to print
switchNodeSwitch bound to the execution pipeline

Implements hh::AbstractPrinter.

Definition at line 231 of file dot_printer.h.

Here is the call graph for this function:

◆ printGraphFooter()

void hh::DotPrinter::printGraphFooter ( core::CoreNode const *  graph)
inlinefinalvirtual

Print the graph footer.

Parameters
graphCore graph node

Implements hh::AbstractPrinter.

Definition at line 205 of file dot_printer.h.

◆ printGraphHeader()

void hh::DotPrinter::printGraphHeader ( core::CoreNode const *  node)
inlinefinalvirtual

Print header for the graph.

Parameters
nodeGraph to print

Implements hh::AbstractPrinter.

Definition at line 156 of file dot_printer.h.

◆ printNodeInformation()

void hh::DotPrinter::printNodeInformation ( core::CoreNode node)
inlinefinalvirtual

Print node main information.

Parameters
nodeNode to print information

Implements hh::AbstractPrinter.

Definition at line 134 of file dot_printer.h.


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