|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Represents a structure type (similar to C struct). More...
#include <sdfg/types/structure.h>
Public Member Functions | |
| Structure (const std::string &name) | |
| Constructs a Structure with the specified name. | |
| Structure (StorageType storage_type, size_t alignment, const std::string &initializer, const std::string &name) | |
| Constructs a Structure with explicit storage, alignment, initializer, and name. | |
| virtual PrimitiveType | primitive_type () const override |
| Returns the primitive type (implementation-defined for structures). | |
| virtual TypeID | type_id () const override |
| Returns TypeID::Structure. | |
| virtual bool | is_symbol () const override |
| Structures are not symbolic types. | |
| const std::string & | name () const |
| Gets the name of this structure type. | |
| virtual bool | operator== (const IType &other) const override |
| Compares this structure with another type for equality. | |
| virtual std::unique_ptr< IType > | clone () const override |
| Creates a deep copy of this structure type. | |
| virtual std::string | print () const override |
| Returns a string representation of this structure type. | |
| bool | is_pointer_like () const override |
| Checks if this structure behaves like a pointer. | |
| 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 structure type (similar to C struct).
Structure types represent composite data types with named members of different types. This is analogous to C/C++ structs. The Structure class holds a reference to a structure type by name, while the actual member layout is defined in StructureDefinition.
Structures can also represent SIMD vector types when configured appropriately.
| sdfg::types::Structure::Structure | ( | const std::string & | name | ) |
Constructs a Structure with the specified name.
| name | The name of the structure type |
| sdfg::types::Structure::Structure | ( | StorageType | storage_type, |
| size_t | alignment, | ||
| const std::string & | initializer, | ||
| const std::string & | name ) |
Constructs a Structure with explicit storage, alignment, initializer, and name.
| storage_type | The storage location and management |
| alignment | Memory alignment in bytes |
| initializer | Optional initializer expression |
| name | The name of the structure type |
|
overridevirtual |
Creates a deep copy of this structure type.
Implements sdfg::types::IType.
|
overridevirtual |
Checks if this structure behaves like a pointer.
Some structures may have pointer-like semantics in certain contexts.
Implements sdfg::types::IType.
|
overridevirtual |
| const std::string & sdfg::types::Structure::name | ( | ) | const |
Gets the name of this structure type.
|
overridevirtual |
Compares this structure with another type for equality.
Implements sdfg::types::IType.
|
overridevirtual |
Returns the primitive type (implementation-defined for structures).
Implements sdfg::types::IType.
|
overridevirtual |
Returns a string representation of this structure type.
Implements sdfg::types::IType.
|
inlineoverridevirtual |
Replace symbolic expressions on this type.
| old_expression | Expression to replace |
| new_expression | Replacement expression |
Nothing to do.
Implements sdfg::types::IType.
|
inlineoverridevirtual |
Implements sdfg::types::IType.
|
overridevirtual |
Returns TypeID::Structure.
Implements sdfg::types::IType.