|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Abstract base interface for all types in the sdfglib type system. More...
#include <sdfg/types/type.h>
Public Member Functions | |
| 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. | |
| virtual TypeID | type_id () const =0 |
| Returns the TypeID for runtime type identification. | |
| StorageType | storage_type () const |
| Gets the storage type (const version). | |
| virtual bool | is_pointer_like () const =0 |
| Checks if this is a pointer or a structure behaves like a pointer. | |
| 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. | |
| virtual PrimitiveType | primitive_type () const =0 |
| Returns the primitive type for this type. | |
| virtual bool | is_symbol () const =0 |
| Checks if this type represents a symbolic/integer type. | |
| virtual bool | operator== (const IType &other) const =0 |
| Compares two types for equality. | |
| virtual std::unique_ptr< IType > | clone () const =0 |
| Creates a deep copy of this type. | |
| virtual std::string | print () const =0 |
| Returns a string representation of this type. | |
| virtual void | replace_symbols (const symbolic::Expression old_expression, const symbolic::Expression new_expression)=0 |
| Replace symbolic expressions on this type. | |
| virtual void | replace_symbols (const symbolic::ExpressionMapping &replacements)=0 |
Protected Attributes | |
| StorageType | storage_type_ |
| Where and how the data is stored. | |
| size_t | alignment_ |
| Memory alignment requirement in bytes. | |
| std::string | initializer_ |
| Optional initializer expression. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const IType &type) |
| Stream output operator for types. | |
Abstract base interface for all types in the sdfglib type system.
IType provides the common interface and properties for all type representations in sdfglib. All concrete type classes (Scalar, Array, Pointer, etc.) inherit from this interface.
|
inline |
Constructs an IType with optional storage, alignment, and initializer.
| storage_type | The storage location and management (default: CPU_Stack) |
| alignment | Memory alignment in bytes (default: 0 for natural alignment) |
| initializer | Optional initializer expression (default: empty) |
|
virtualdefault |
Virtual destructor for proper cleanup of derived classes.
|
inline |
Gets the alignment requirement in bytes.
|
inline |
Sets the alignment requirement in bytes.
|
pure virtual |
Creates a deep copy of this type.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
inline |
Gets the initializer expression.
|
inline |
Sets the initializer expression.
|
pure virtual |
Checks if this is a pointer or a structure behaves like a pointer.
Some structures may have pointer-like semantics in certain contexts.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
pure virtual |
Checks if this type represents a symbolic/integer type.
Symbolic types are integer types that can be used in symbolic expressions and loop bounds.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
pure virtual |
Compares two types for equality.
| other | The type to compare with |
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
pure virtual |
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.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
pure virtual |
Returns a string representation of this type.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
pure virtual |
Replace symbolic expressions on this type.
| old_expression | Expression to replace |
| new_expression | Replacement expression |
Replaces occurrences of symbolic expressions on the type.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
pure virtual |
|
inline |
Gets the storage type (mutable reference).
|
inline |
Gets the storage type (const version).
|
inline |
Sets the storage type.
|
pure virtual |
Returns the TypeID for runtime type identification.
Implemented in sdfg::codegen::Reference, sdfg::types::Array, sdfg::types::Function, sdfg::types::Pointer, sdfg::types::Scalar, sdfg::types::Structure, and sdfg::types::Tensor.
|
friend |
Stream output operator for types.
| os | The output stream |
| type | The type to output |
|
protected |
Memory alignment requirement in bytes.
|
protected |
Optional initializer expression.
|
protected |
Where and how the data is stored.