GEGELATI
tpgEdge.h
1
36#ifndef TPG_EDGE_H
37#define TPG_EDGE_H
38
39#include <memory>
40
41#include "program/program.h"
42
43namespace TPG {
44 // Declare class to make it usable as an attribute.
45 class TPGVertex;
46
50 class TPGEdge
51 {
52 public:
54 virtual ~TPGEdge() = default;
55
67 TPGEdge(const TPGVertex* src, const TPGVertex* dest,
68 const std::shared_ptr<Program::Program> prog)
69 : source{src}, destination{dest}, program{prog} {};
70
77
88 void setProgram(const std::shared_ptr<Program::Program> prog) const;
89
98 std::shared_ptr<Program::Program> getProgramSharedPointer();
99
105 const TPGVertex* getSource() const;
106
112 void setSource(TPGVertex* newSource);
113
119 const TPGVertex* getDestination() const;
120
127 void setDestination(TPGVertex* newDestination);
128
129 protected:
132
135
140 mutable std::shared_ptr<Program::Program> program;
141
143 TPGEdge() = delete;
144 };
145}; // namespace TPG
146
147#endif
The Program class contains a list of program lines that can be executed within a well defined Environ...
Definition: program.h:53
Class representing edges of the Tangled Program Graphs.
Definition: tpgEdge.h:51
std::shared_ptr< Program::Program > program
Definition: tpgEdge.h:140
TPGEdge()=delete
Delete the default constructor.
virtual ~TPGEdge()=default
Default virtual destructor (for polymorphism)
const TPGVertex * source
Pointer to the source TPGVertex of this TPGEdge.
Definition: tpgEdge.h:131
const TPGVertex * getDestination() const
Get the destination TPGVertex of the TPGEdge.
Definition: tpgEdge.cpp:64
void setDestination(TPGVertex *newDestination)
Set a new destination TPGVertex to the TPGEdge.
Definition: tpgEdge.cpp:69
const TPGVertex * getSource() const
Get the source TPGVertex of the TPGEdge.
Definition: tpgEdge.cpp:54
const TPGVertex * destination
Pointer to the destination TPGVertex of this TPGEdge.
Definition: tpgEdge.h:134
Program::Program & getProgram() const
Get a const reference to the Program of the TPGEdge.
Definition: tpgEdge.cpp:38
void setSource(TPGVertex *newSource)
Set a new source TPGVertex to the TPGEdge.
Definition: tpgEdge.cpp:59
std::shared_ptr< Program::Program > getProgramSharedPointer()
Get the shared_pointer to the Program.
Definition: tpgEdge.cpp:49
TPGEdge(const TPGVertex *src, const TPGVertex *dest, const std::shared_ptr< Program::Program > prog)
Main constructor of the TPGEdge class.
Definition: tpgEdge.h:67
void setProgram(const std::shared_ptr< Program::Program > prog) const
Set a new Program for the TPGEdge.
Definition: tpgEdge.cpp:43
Abstract class representing the vertices of a TPGGraph.
Definition: tpgVertex.h:49
Definition: tpgActionInstrumented.h:8