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

A special state that returns a value from the SDFG. More...

#include <sdfg/control_flow/state.h>

Inheritance diagram for sdfg::control_flow::ReturnState:
[legend]

Public Member Functions

 ReturnState (const ReturnState &state)=delete
ReturnState & operator= (const ReturnState &)=delete
const std::string & data () const
 Returns the data or constant value being returned.
const types::IType & type () const
 Returns the type of the constant being returned.
bool is_data () const
 Checks if this return state returns a data container.
bool is_constant () const
 Checks if this return state returns a constant value.
void validate (const Function &function) const override
 Validates the return state within the context of a function.
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replaces symbolic expressions in the return state.
Public Member Functions inherited from sdfg::control_flow::State
 State (const State &state)=delete
State & operator= (const State &)=delete
ElementType type_id () const override
 Returns the type of the element.
void validate (const Function &function) const override
 Validates the state within the context of a function.
graph::Vertex vertex () const
 Returns the graph vertex representing this state.
const data_flow::DataFlowGraph & dataflow () const
 Returns the data-flow graph of this state (const version).
data_flow::DataFlowGraph & dataflow ()
 Returns the data-flow graph of this state (mutable version).
void replace (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replaces symbolic expressions in the state's data-flow graph.
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.
virtual void replace (const symbolic::ExpressionMapping &replacements)

Friends

class sdfg::builder::SDFGBuilder

Additional Inherited Members

Static Public Member Functions inherited from sdfg::control_flow::State
static bool classof (const Element &element)
Protected Member Functions inherited from sdfg::control_flow::State
 State (size_t element_id, const DebugInfo &debug_info, const graph::Vertex vertex)
Protected Attributes inherited from sdfg::Element
size_t element_id_
DebugInfo debug_info_
std::unordered_map< std::string, std::string > metadata_

Detailed Description

A special state that returns a value from the SDFG.

ReturnState represents the termination point of an SDFG execution path. It can return either:

  • A data container (variable) defined in the function
  • A constant value with an associated type

A ReturnState must not have any outgoing edges.

See also
State for the base state functionality

Constructor & Destructor Documentation

◆ ReturnState()

sdfg::control_flow::ReturnState::ReturnState ( const ReturnState & state)
delete

Member Function Documentation

◆ data()

const std::string & sdfg::control_flow::ReturnState::data ( ) const

Returns the data or constant value being returned.

Returns
The name of the data container or the constant value string

◆ is_constant()

bool sdfg::control_flow::ReturnState::is_constant ( ) const

Checks if this return state returns a constant value.

Returns
true if returning a constant value, false otherwise

◆ is_data()

bool sdfg::control_flow::ReturnState::is_data ( ) const

Checks if this return state returns a data container.

Returns
true if returning a data container, false otherwise

◆ operator=()

ReturnState & sdfg::control_flow::ReturnState::operator= ( const ReturnState & )
delete

◆ replace()

void sdfg::control_flow::ReturnState::replace ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replaces symbolic expressions in the return state.

Parameters
old_expressionThe expression to replace
new_expressionThe replacement expression

Implements sdfg::Element.

◆ type()

const types::IType & sdfg::control_flow::ReturnState::type ( ) const

Returns the type of the constant being returned.

Returns
The type of the constant (only valid if is_constant() returns true)

◆ validate()

void sdfg::control_flow::ReturnState::validate ( const Function & function) const
overridevirtual

Validates the return state within the context of a function.

Parameters
functionThe function containing this return state
Exceptions
InvalidSDFGExceptionif validation fails (e.g., has outgoing edges)

Implements sdfg::Element.

◆ sdfg::builder::SDFGBuilder

friend class sdfg::builder::SDFGBuilder
friend

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