Hedgehog  0.0.0
A library to generate hybrid pipeline workflow systems
abstract_printer.h
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 #ifndef HEDGEHOG_ABSTRACT_PRINTER_H
21 #define HEDGEHOG_ABSTRACT_PRINTER_H
22 #include <set>
23 #include "../../tools/logger.h"
25 namespace hh {
26 
27 
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 namespace core {
32 class CoreNode;
33 }
34 #endif //DOXYGEN_SHOULD_SKIP_THIS
35 
39  private:
40  std::set<core::CoreNode const *> uniqueNodes_ = {};
41  public:
43  AbstractPrinter() = default;
44 
46  virtual ~AbstractPrinter() = default;
47 
50  virtual void printGraphHeader(core::CoreNode const *node) = 0;
51 
54  virtual void printGraphFooter(core::CoreNode const *node) = 0;
55 
58  virtual void printNodeInformation(core::CoreNode *node) = 0;
59 
67  virtual void printEdge(core::CoreNode const *from,
68  core::CoreNode const *to,
69  std::string_view const &edgeType,
70  size_t const &queueSize,
71  size_t const &maxQueueSize,
72  bool isMemoryManaged) = 0;
73 
76  virtual void printClusterHeader(core::CoreNode const *clusterNode) = 0;
77 
79  virtual void printClusterFooter() = 0;
80 
83  virtual void printClusterEdge(core::CoreNode const *clusterNode) = 0;
84 
88  virtual void printExecutionPipelineHeader(core::CoreNode *epNode, core::CoreNode *switchNode) = 0;
89 
91  virtual void printExecutionPipelineFooter() = 0;
92 
100  virtual void printEdgeSwitchGraphs(core::CoreNode *to,
101  std::string const &idSwitch,
102  std::string_view const &edgeType,
103  size_t const &queueSize,
104  size_t const &maxQueueSize,
105  bool isMemoryManaged) = 0;
106 
110  bool hasNotBeenVisited(core::CoreNode const *node) {
111  return uniqueNodes_.insert(node).second;
112  }
113 };
114 }
115 #endif //HEDGEHOG_ABSTRACT_PRINTER_H
Hedgehog main namespace.
Printer interface.
bool hasNotBeenVisited(core::CoreNode const *node)
Accessor to check if a node has been visited by the printer.
Main Hedgehog core abstraction.
Definition: core_node.h:48