Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
printer.h
Go to the documentation of this file.
1// NIST-developed software is provided by NIST as a public service. You may use, copy and distribute copies of the
2// software in any medium, provided that you keep intact this entire notice. You may improve, modify and create
3// derivative works of the software or any portion of the software, and you may copy and distribute such modifications
4// or works. Modified works should carry a notice stating that you changed the software and should note the date and
5// nature of any such change. Please explicitly acknowledge the National Institute of Standards and Technology as the
6// source of the software. NIST-developed software is expressly provided "AS IS." NIST MAKES NO WARRANTY OF ANY KIND,
7// EXPRESS, IMPLIED, IN FACT OR ARISING BY OPERATION OF LAW, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
8// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY. NIST NEITHER REPRESENTS NOR
9// WARRANTS THAT THE OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ANY DEFECTS WILL BE
10// CORRECTED. NIST DOES NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF THE SOFTWARE OR THE RESULTS
11// THEREOF, INCLUDING BUT NOT LIMITED TO THE CORRECTNESS, ACCURACY, RELIABILITY, OR USEFULNESS OF THE SOFTWARE. You
12// are solely responsible for determining the appropriateness of using and distributing the software and you assume
13// all risks associated with its use, including but not limited to the risks and costs of program errors, compliance
14// with applicable laws, damage to or loss of data, programs or equipment, and the unavailability or interruption of
15// operation. This software is not intended to be used in any situation where a failure could cause risk of injury or
16// damage to property. The software developed by NIST employees is not subject to copyright protection within the
17// United States.
18
19
20
21#ifndef HEDGEHOG_PRINTER_H
22#define HEDGEHOG_PRINTER_H
23
24#include <set>
25#include <memory>
26#include <ostream>
27
29namespace hh {
30
32namespace core {
34namespace abstraction {
35
36#ifndef DOXYGEN_SHOULD_SKIP_THIS
37
39class NodeAbstraction;
46#endif //DOXYGEN_SHOULD_SKIP_THIS
47
48}
49}
50
52class Printer {
53 private:
54 std::unique_ptr<std::set<core::abstraction::NodeAbstraction const * >>
55 uniqueNodes_ = nullptr;
56
57 public:
59 Printer() : uniqueNodes_(std::make_unique<std::set<core::abstraction::NodeAbstraction const * >>()) {}
60
62 virtual ~Printer() = default;
63
67
71
77 core::abstraction::NodeAbstraction const *switchNode) = 0;
78
80 virtual void printExecutionPipelineFooter() = 0;
81
85
93 std::string const &edgeType,
94 size_t const &queueSize, size_t const &maxQueueSize) = 0;
95
99 virtual void printGroup(core::abstraction::NodeAbstraction *representative,
100 std::vector<core::abstraction::NodeAbstraction *> const &group) = 0;
101
104 virtual void printSource(core::abstraction::NodeAbstraction const *source) = 0;
105
108 virtual void printSink(core::abstraction::NodeAbstraction const *sink) = 0;
109
114 return uniqueNodes_->insert(nodeAbstraction).second;
115 }
116};
117
118}
119#endif //HEDGEHOG_PRINTER_H
Hedgehog main namespace.
Printer abstraction to get a snapshot of the metrics of the Hedgehog graph.
Definition: printer.h:52
Printer()
Default constructor.
Definition: printer.h:59
std::unique_ptr< std::set< core::abstraction::NodeAbstraction const * > > uniqueNodes_
Uniques Nodes registered (already printed)
Definition: printer.h:55
virtual void printSource(core::abstraction::NodeAbstraction const *source)=0
Print outer graph source.
virtual void printGraphFooter(core::abstraction::GraphNodeAbstraction const *graph)=0
Print graph footer.
bool registerNode(core::abstraction::NodeAbstraction const *nodeAbstraction)
Register a visited node.
Definition: printer.h:113
virtual void printSink(core::abstraction::NodeAbstraction const *sink)=0
Print outer graph sink.
virtual void printExecutionPipelineFooter()=0
Print execution pipeline footer.
virtual void printGroup(core::abstraction::NodeAbstraction *representative, std::vector< core::abstraction::NodeAbstraction * > const &group)=0
Print group of nodes.
virtual void printNodeInformation(core::abstraction::NodeAbstraction const *node)=0
Print node information.
virtual void printEdge(core::abstraction::NodeAbstraction const *from, core::abstraction::NodeAbstraction const *to, std::string const &edgeType, size_t const &queueSize, size_t const &maxQueueSize)=0
Print edge information.
virtual ~Printer()=default
Default destructor.
virtual void printGraphHeader(core::abstraction::GraphNodeAbstraction const *graph)=0
Print graph header.
virtual void printExecutionPipelineHeader(core::abstraction::ExecutionPipelineNodeAbstraction const *ep, core::abstraction::NodeAbstraction const *switchNode)=0
Print execution pipeline header.
Abstraction for cores/nodes that can form groups.