|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Represents a c-style array type. More...
#include <sdfg/types/array.h>
Public Member Functions | |
| Array (const IType &element_type, const symbolic::Expression num_elements) | |
| Constructs an Array with the specified element type and size. | |
| Array (StorageType storage_type, size_t alignment, const std::string &initializer, const IType &element_type, const symbolic::Expression num_elements) | |
| Constructs an Array with explicit storage, alignment, initializer, element type, and size. | |
| virtual PrimitiveType | primitive_type () const override |
| Returns the primitive type of the array's elements. | |
| virtual TypeID | type_id () const override |
| Returns TypeID::Array. | |
| virtual bool | is_symbol () const override |
| Arrays are not symbolic types. | |
| bool | is_pointer_like () const override |
| Checks if this is a pointer or a structure behaves like a pointer. | |
| const IType & | element_type () const |
| Gets the type of elements in this array. | |
| const symbolic::Expression | num_elements () const |
| Gets the number of elements in this array. | |
| virtual bool | operator== (const IType &other) const override |
| Compares this array with another type for equality. | |
| virtual std::unique_ptr< IType > | clone () const override |
| Creates a deep copy of this array type. | |
| virtual std::string | print () const override |
| Returns a string representation of this array 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. | |
Represents a c-style array type.
The Array class represents a fixed-size sequence of elements of the same type. This corresponds to C-style arrays like int[10] or float[N] where N is a symbolic expression.
Arrays can be nested to create multi-dimensional arrays. The number of elements can be specified as either a concrete integer or a symbolic expression that may depend on parameters or variables.
| sdfg::types::Array::Array | ( | const IType & | element_type, |
| const symbolic::Expression | num_elements ) |
Constructs an Array with the specified element type and size.
| element_type | The type of elements in the array |
| num_elements | The number of elements (can be a symbolic expression) |
| sdfg::types::Array::Array | ( | StorageType | storage_type, |
| size_t | alignment, | ||
| const std::string & | initializer, | ||
| const IType & | element_type, | ||
| const symbolic::Expression | num_elements ) |
Constructs an Array with explicit storage, alignment, initializer, element type, and size.
| storage_type | The storage location and management |
| alignment | Memory alignment in bytes |
| initializer | Optional initializer expression |
| element_type | The type of elements in the array |
| num_elements | The number of elements (can be a symbolic expression) |
|
overridevirtual |
Creates a deep copy of this array type.
Implements sdfg::types::IType.
| const IType & sdfg::types::Array::element_type | ( | ) | const |
Gets the type of elements in this array.
|
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.
|
overridevirtual |
| const symbolic::Expression sdfg::types::Array::num_elements | ( | ) | const |
Gets the number of elements in this array.
|
overridevirtual |
Compares this array with another type for equality.
Implements sdfg::types::IType.
|
overridevirtual |
Returns the primitive type of the array's elements.
For nested arrays, this returns the primitive type of the innermost element.
Implements sdfg::types::IType.
|
overridevirtual |
Returns a string representation of this array type.
Implements sdfg::types::IType.
|
overridevirtual |
Replace symbolic expressions on this type.
| old_expression | Expression to replace |
| new_expression | Replacement expression |
Replaces occurrences of symbolic expressions on the type.
Implements sdfg::types::IType.
|
overridevirtual |
Implements sdfg::types::IType.
|
overridevirtual |
Returns TypeID::Array.
Implements sdfg::types::IType.