docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sequence.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
7
8namespace sdfg {
9
10class StructuredSDFG;
11
12namespace builder {
14}
15
17
18class While;
19class StructuredLoop;
20class Sequence;
21
52class Sequence : public ControlFlowNode {
54
56
59
60private:
61 std::vector<std::unique_ptr<ControlFlowNode>> children_;
62
63 Sequence(size_t element_id, const DebugInfo& debug_info, ControlFlowNode* parent);
64
65 static constexpr size_t REQUIRED_ELEMENT_IDS = 1;
66
67public:
68 Sequence(const Sequence& node) = delete;
69 Sequence& operator=(const Sequence&) = delete;
70
71 ElementType type_id() const override {
73 }
74
75 static bool classof(const Element& element) {
76 return element.type_id() == ElementType::Sequence;
77 }
78
80
81 void validate(const Function& function) const override;
82
87 size_t size() const;
88
95 const ControlFlowNode& at(size_t i) const;
96
103 ControlFlowNode& at(size_t i);
104
110 int index(const ControlFlowNode& child) const;
111
117 void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override;
118 void replace(const symbolic::ExpressionMapping& replacements) override;
119};
120
121} // namespace structured_control_flow
122} // namespace sdfg
Definition element.h:30
Element(size_t element_id, const DebugInfo &debug_info)
size_t element_id() const
const DebugInfo & debug_info() const
virtual ElementType type_id() const =0
Returns the type of the element.
Definition function.h:43
Definition structured_sdfg.h:30
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
ControlFlowNode(size_t element_id, const DebugInfo &debug_info, ControlFlowNode *parent)
Protected constructor for control flow nodes with parent.
A sequential container of control flow nodes.
Definition sequence.h:52
int index(const ControlFlowNode &child) const
Find the index of a child node.
ElementType type_id() const override
Returns the type of the element.
Definition sequence.h:71
const ControlFlowNode & at(size_t i) const
Access a child by index (const version).
static bool classof(const Element &element)
Definition sequence.h:75
void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
Replace occurrences of an expression in all children and transitions.
Sequence & operator=(const Sequence &)=delete
ControlFlowNode & at(size_t i)
Access a child by index (non-const version).
bool accept(visitor::ActualStructuredSDFGVisitor &visitor) override
Sequence(const Sequence &node)=delete
size_t size() const
Get the number of children in this sequence.
void replace(const symbolic::ExpressionMapping &replacements) override
void validate(const Function &function) const override
Validates the element.
Base class for structured loop constructs.
Definition structured_loop.h:244
Represents a while-loop with condition-controlled iteration.
Definition while.h:37
Visitor for Structured SDFG (not a builder).
Definition structured_sdfg_visitor.h:71
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
SymEngine::map_basic_basic ExpressionMapping
Definition symbolic.h:109
Definition function_builder.h:10
Definition language_extension.h:18
Definition control_flow_node.h:16
Definition analysis.h:7
ElementType
Definition element.h:72
@ Sequence
Definition element.h:82