docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::structured_control_flow::Sequence Class Reference

A sequential container of control flow nodes. More...

#include <sdfg/structured_control_flow/sequence.h>

Inheritance diagram for sdfg::structured_control_flow::Sequence:
[legend]

Public Member Functions

 Sequence (const Sequence &node)=delete
Sequence & operator= (const Sequence &)=delete
ElementType type_id () const override
 Returns the type of the element.
bool accept (visitor::ActualStructuredSDFGVisitor &visitor) override
void validate (const Function &function) const override
 Validates the element.
size_t size () const
 Get the number of children in this sequence.
const ControlFlowNode & at (size_t i) const
 Access a child by index (const version).
ControlFlowNode & at (size_t i)
 Access a child by index (non-const version).
int index (const ControlFlowNode &child) const
 Find the index of a child node.
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replace occurrences of an expression in all children and transitions.
void replace (const symbolic::ExpressionMapping &replacements) override
Public Member Functions inherited from sdfg::structured_control_flow::ControlFlowNode
virtual ~ControlFlowNode ()=default
ControlFlowNode * get_parent ()
const ControlFlowNode * get_parent () const
 ControlFlowNode (const ControlFlowNode &node)=delete
ControlFlowNode & operator= (const ControlFlowNode &)=delete
Public Member Functions inherited from sdfg::Element
 Element (size_t element_id, const DebugInfo &debug_info)
virtual ~Element ()=default
size_t element_id () const
const DebugInfo & debug_info () const
void set_debug_info (const DebugInfo &debug_info)
void add_metadata (const std::string &key, const std::string &value)
void remove_metadata (const std::string &key)
const std::string & metadata (const std::string &key) const
const std::string * metadata_if_exists (const std::string &key) const
const std::unordered_map< std::string, std::string > & metadata () const
std::string_view element_type () const
 Returns the type of the element as a human-readable string.

Static Public Member Functions

static bool classof (const Element &element)
Static Public Member Functions inherited from sdfg::structured_control_flow::ControlFlowNode
static bool classof (const Element &element)
 LLVM-style RTTI predicate: true if element is a ControlFlowNode.
static std::vector< ControlFlowNode * > parent_chain (ControlFlowNode &child)

Friends

class sdfg::builder::StructuredSDFGBuilder
class sdfg::StructuredSDFG
class sdfg::structured_control_flow::While
class sdfg::structured_control_flow::StructuredLoop

Additional Inherited Members

Static Public Attributes inherited from sdfg::structured_control_flow::ControlFlowNode
static constexpr ElementType TypeGroup
 Bitmask of all concrete ElementTypes that are ControlFlowNodes.
Protected Member Functions inherited from sdfg::structured_control_flow::ControlFlowNode
 ControlFlowNode (size_t element_id, const DebugInfo &debug_info, ControlFlowNode *parent)
 Protected constructor for control flow nodes with parent.
Protected Attributes inherited from sdfg::structured_control_flow::ControlFlowNode
ControlFlowNode * parent_
Protected Attributes inherited from sdfg::Element
size_t element_id_
DebugInfo debug_info_
std::unordered_map< std::string, std::string > metadata_

Detailed Description

A sequential container of control flow nodes.

A Sequence represents a sequential execution of control flow nodes. It is the fundamental container in structured control flow, serving as:

A Sequence contains:

  • A list of child control flow nodes (Block, IfElse, loops, etc.)
  • A transition for each child (containing symbol assignments)

Children are executed sequentially in order. After each child completes, its associated transition executes, potentially updating symbol values before the next child begins.

Structure:

Sequence:
Child[0] -> Transition[0] (assignments)
Child[1] -> Transition[1] (assignments)
...
Child[n-1] -> Transition[n-1] (assignments)
See also
ControlFlowNode
Transition
StructuredSDFG::root()

Constructor & Destructor Documentation

◆ Sequence()

sdfg::structured_control_flow::Sequence::Sequence ( const Sequence & node)
delete

Member Function Documentation

◆ accept()

bool sdfg::structured_control_flow::Sequence::accept ( visitor::ActualStructuredSDFGVisitor & visitor)
overridevirtual

◆ at() [1/2]

ControlFlowNode & sdfg::structured_control_flow::Sequence::at ( size_t i)

Access a child by index (non-const version).

Parameters
iIndex of the child to access (0-based)
Returns
child node
Exceptions
std::out_of_rangeif i >= size()

◆ at() [2/2]

const ControlFlowNode & sdfg::structured_control_flow::Sequence::at ( size_t i) const

Access a child by index (const version).

Parameters
iIndex of the child to access (0-based)
Returns
child node
Exceptions
std::out_of_rangeif i >= size()

◆ classof()

bool sdfg::structured_control_flow::Sequence::classof ( const Element & element)
inlinestatic

◆ index()

int sdfg::structured_control_flow::Sequence::index ( const ControlFlowNode & child) const

Find the index of a child node.

Parameters
childChild node to search for
Returns
Index of the child, or -1 if not found

◆ operator=()

Sequence & sdfg::structured_control_flow::Sequence::operator= ( const Sequence & )
delete

◆ replace() [1/2]

void sdfg::structured_control_flow::Sequence::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replace occurrences of an expression in all children and transitions.

Parameters
old_expressionExpression to replace
new_expressionExpression to replace with

Implements sdfg::Element.

◆ replace() [2/2]

void sdfg::structured_control_flow::Sequence::replace ( const symbolic::ExpressionMapping & replacements)
overridevirtual

Reimplemented from sdfg::Element.

◆ size()

size_t sdfg::structured_control_flow::Sequence::size ( ) const

Get the number of children in this sequence.

Returns
Number of child control flow nodes

◆ type_id()

ElementType sdfg::structured_control_flow::Sequence::type_id ( ) const
inlineoverridevirtual

Returns the type of the element.

Implements sdfg::Element.

◆ validate()

void sdfg::structured_control_flow::Sequence::validate ( const Function & function) const
overridevirtual

Validates the element.

Exceptions
InvalidSDFGExceptionif the element is invalid

Implements sdfg::Element.

◆ sdfg::builder::StructuredSDFGBuilder

◆ sdfg::structured_control_flow::StructuredLoop

◆ sdfg::structured_control_flow::While

◆ sdfg::StructuredSDFG

friend class sdfg::StructuredSDFG
friend

The documentation for this class was generated from the following file:
  • sdfg/include/sdfg/structured_control_flow/sequence.h