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

#include <sdfg/codegen/utils.h>

Inheritance diagram for sdfg::codegen::Reference:
[legend]

Public Member Functions

 Reference (const types::IType &reference_)
 Reference (types::StorageType storage_type, size_t alignment, const std::string &initializer, const types::IType &reference_)
std::unique_ptr< types::IType > clone () const override
 Creates a deep copy of this type.
virtual types::TypeID type_id () const override
 Returns the TypeID for runtime type identification.
types::PrimitiveType primitive_type () const override
 Returns the primitive type for this type.
bool is_symbol () const override
 Checks if this type represents a symbolic/integer type.
bool is_pointer_like () const override
 Checks if this is a pointer or a structure behaves like a pointer.
const types::IType & reference_type () const
bool operator== (const types::IType &other) const override
 Compares two types for equality.
std::string print () const override
 Returns a string representation of this type.
virtual void replace_symbols (const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
 Replace symbolic expressions on this type.
virtual void replace_symbols (const symbolic::ExpressionMapping &replacements) override
Public Member Functions inherited from sdfg::types::IType
 IType (StorageType storage_type=StorageType::CPU_Stack(), size_t alignment=0, const std::string &initializer="")
 Constructs an IType with optional storage, alignment, and initializer.
virtual ~IType ()=default
 Virtual destructor for proper cleanup of derived classes.
StorageType storage_type () const
 Gets the storage type (const version).
StorageType & storage_type ()
 Gets the storage type (mutable reference).
void storage_type (const StorageType &storage_type)
 Sets the storage type.
size_t alignment () const
 Gets the alignment requirement in bytes.
void alignment (size_t alignment)
 Sets the alignment requirement in bytes.
std::string initializer () const
 Gets the initializer expression.
void initializer (const std::string &initializer)
 Sets the initializer expression.

Additional Inherited Members

Protected Attributes inherited from sdfg::types::IType
StorageType storage_type_
 Where and how the data is stored.
size_t alignment_
 Memory alignment requirement in bytes.
std::string initializer_
 Optional initializer expression.

Constructor & Destructor Documentation

◆ Reference() [1/2]

sdfg::codegen::Reference::Reference ( const types::IType & reference_)

◆ Reference() [2/2]

sdfg::codegen::Reference::Reference ( types::StorageType storage_type,
size_t alignment,
const std::string & initializer,
const types::IType & reference_ )

Member Function Documentation

◆ clone()

std::unique_ptr< types::IType > sdfg::codegen::Reference::clone ( ) const
overridevirtual

Creates a deep copy of this type.

Returns
A unique pointer to a new type object with the same properties

Implements sdfg::types::IType.

◆ is_pointer_like()

bool sdfg::codegen::Reference::is_pointer_like ( ) const
inlineoverridevirtual

Checks if this is a pointer or a structure behaves like a pointer.

Some structures may have pointer-like semantics in certain contexts.

Implements sdfg::types::IType.

◆ is_symbol()

bool sdfg::codegen::Reference::is_symbol ( ) const
overridevirtual

Checks if this type represents a symbolic/integer type.

Symbolic types are integer types that can be used in symbolic expressions and loop bounds.

Returns
true if this is a symbolic integer type, false otherwise

Implements sdfg::types::IType.

◆ operator==()

bool sdfg::codegen::Reference::operator== ( const types::IType & other) const
overridevirtual

Compares two types for equality.

Parameters
otherThe type to compare with
Returns
true if the types are equal, false otherwise

Implements sdfg::types::IType.

◆ primitive_type()

types::PrimitiveType sdfg::codegen::Reference::primitive_type ( ) const
overridevirtual

Returns the primitive type for this type.

For scalar types, this returns the actual primitive type. For composite types (arrays, pointers, etc.), this returns the primitive type of the innermost element.

Returns
The primitive type

Implements sdfg::types::IType.

◆ print()

std::string sdfg::codegen::Reference::print ( ) const
overridevirtual

Returns a string representation of this type.

Returns
A human-readable string describing this type

Implements sdfg::types::IType.

◆ reference_type()

const types::IType & sdfg::codegen::Reference::reference_type ( ) const

◆ replace_symbols() [1/2]

virtual void sdfg::codegen::Reference::replace_symbols ( const symbolic::Expression old_expression,
const symbolic::Expression new_expression )
overridevirtual

Replace symbolic expressions on this type.

Parameters
old_expressionExpression to replace
new_expressionReplacement expression

Replaces occurrences of symbolic expressions on the type.

Implements sdfg::types::IType.

◆ replace_symbols() [2/2]

virtual void sdfg::codegen::Reference::replace_symbols ( const symbolic::ExpressionMapping & replacements)
overridevirtual

Implements sdfg::types::IType.

◆ type_id()

virtual types::TypeID sdfg::codegen::Reference::type_id ( ) const
overridevirtual

Returns the TypeID for runtime type identification.

Returns
The TypeID enum value for this type

Implements sdfg::types::IType.


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