Hedgehog  3.1.0
A library to generate hybrid pipeline workflow systems
Loading...
Searching...
No Matches
execution_pipeline_outputs_management_abstraction.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#ifndef HEDGEHOG_EXECUTION_PIPELINE_OUTPUTS_MANAGEMENT_ABSTRACTION_H_
20#define HEDGEHOG_EXECUTION_PIPELINE_OUTPUTS_MANAGEMENT_ABSTRACTION_H_
21
22#include "../base/input_output/notifier_abstraction.h"
23#include "../base/input_output/sender_abstraction.h"
24#include "../../implementors/concrete_implementor/graph/graph_notifier.h"
25#include "../../implementors/concrete_implementor/graph/graph_sender.h"
27
29namespace hh {
31namespace core {
33namespace abstraction {
34
37template<class ...Outputs>
39 : public NotifierAbstraction,
40 public SenderAbstraction<Outputs> ...{
41 public:
42
45 : NotifierAbstraction(std::make_shared<implementor::GraphNotifier>()),
46 SenderAbstraction<Outputs>(std::make_shared<implementor::GraphSender<Outputs>>())...{}
47
50
54 (this->registerGraphSender<Outputs>(std::static_pointer_cast<SenderAbstraction<Outputs>>(coreGraph)), ...);
55 for(auto outputNodeNotifier : coreGraph->notifiers()){
56 this->notifiers().insert(outputNodeNotifier);
57 }
58 }
59
62 void duplicateOutputEdges(std::map<abstraction::NodeAbstraction *, std::shared_ptr<NodeAbstraction>> &mapping){
64 this->duplicateEdgeNotifier(mapping);
65 }
66
67 private:
71 template <class Output>
72 void registerGraphSender(std::shared_ptr<SenderAbstraction<Output>> coreGraphSender){
73 for(auto outputNodeSender : coreGraphSender->senders()){
74 (static_cast<SenderAbstraction<Output>*>(this))->senders().insert(outputNodeSender);
75 }
76 }
77
78};
79}
80}
81}
82#endif //HEDGEHOG_EXECUTION_PIPELINE_OUTPUTS_MANAGEMENT_ABSTRACTION_H_
Hedgehog main namespace.
Core abstraction to notify slots.
void duplicateEdgeNotifier(std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping)
Duplicate edges of the current notifier to slots to clone in map.
std::set< NotifierAbstraction * > const & notifiers() const
Const accessor to notifiers.
Core abstraction to send data.
void duplicateEdgeSender(std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping)
Duplicate edges of the current sender to receiver to clone in map.
void duplicateOutputEdges(std::map< abstraction::NodeAbstraction *, std::shared_ptr< NodeAbstraction > > &mapping)
Duplicate output edges.
~ExecutionPipelineOutputsManagementAbstraction() override=default
Default destructor.
void registerGraphOutputNodes(std::shared_ptr< GraphOutputsManagementAbstraction< Outputs... > > coreGraph)
Register output node as output of the execution pipeline.
void registerGraphSender(std::shared_ptr< SenderAbstraction< Output > > coreGraphSender)
Register output node as output of the execution pipeline for a type.