Files
WFR-lib/include/wfr/wep/utils/WepDotFileWriter.h
T
2017-04-11 15:49:21 +02:00

54 lines
1.1 KiB
C++
Executable File

#pragma once
#include <string>
#include <fstream>
#include <memory>
#include <set>
namespace wfr {
namespace wep {
// Forward declarations
class WorkflowExecutionPlan;
class AbstractWepNode;
// main namespace
namespace utils {
class WepDotFileWriter {
// Invariant properties that can be accessed directly.
public:
typedef std::set<AbstractWepNode*> visitedNodes_t;
const std::shared_ptr<WorkflowExecutionPlan> wep;
const std::string workflowName;
// Non-Public functions
private:
void writeWepNodeAndEdges(std::ofstream& outfile, AbstractWepNode* node, visitedNodes_t& visitedNodes);
std::string getNodeType(AbstractWepNode* node);
std::string getNodeLabel(AbstractWepNode* node);
std::string getNodeID(AbstractWepNode* node);
std::string getNodeShape(AbstractWepNode* node);
std::string getNodeStatus(AbstractWepNode* node);
std::string getNodeVisitationCount(AbstractWepNode* node);
public:
WepDotFileWriter(const std::shared_ptr<WorkflowExecutionPlan>& wep) noexcept;
void printToFile();
void printToFile(const std::string fileName);
};
} /* namespace utils */
} /* namespace wep */
} /* namespace wfr */