76 const std::string&
name()
const;
82 virtual std::unique_ptr<IType>
clone()
const override;
85 virtual std::string
print()
const override;
124 std::vector<std::unique_ptr<IType>> members_;
138 std::unique_ptr<StructureDefinition>
clone()
const;
144 const std::string&
name()
const;
Definition function_builder.h:12
Abstract base interface for all types in the sdfglib type system.
Definition type.h:625
IType(StorageType storage_type=StorageType::CPU_Stack(), size_t alignment=0, const std::string &initializer="")
Constructs an IType with optional storage, alignment, and initializer.
Definition type.h:638
StorageType storage_type() const
Gets the storage type (const version).
Definition type.h:651
std::string initializer() const
Gets the initializer expression.
Definition type.h:683
size_t alignment() const
Gets the alignment requirement in bytes.
Definition type.h:673
Represents a scalar primitive type.
Definition scalar.h:27
Represents the storage location and management characteristics of data.
Definition type.h:64
size_t num_members() const
Gets the number of members in this structure.
static const Structure & create_vector_type(const builder::FunctionBuilder &builder, const Scalar &element_type, size_t vector_size)
Creates or retrieves a vector type structure.
const IType & member_type(symbolic::Integer index) const
Gets the type of a member at the specified index.
bool is_packed() const
Checks if this structure is packed.
const std::string & name() const
Gets the name of this structure.
const size_t vector_size() const
Gets the size of a vector structure.
bool is_vector() const
Checks if this structure represents a SIMD vector type.
StructureDefinition(const std::string &name, bool is_packed)
Constructs a StructureDefinition with the specified name and packing.
void replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression)
Replace symbolic expressions on the members.
void add_member(const IType &member_type)
Adds a member to this structure.
std::unique_ptr< StructureDefinition > clone() const
Creates a deep copy of this structure definition.
const Scalar & vector_element_type() const
Gets the element type of a vector structure.
void replace_symbols(const symbolic::ExpressionMapping &replacements)
Represents a structure type (similar to C struct).
Definition structure.h:37
virtual std::string print() const override
Returns a string representation of this structure type.
Structure(const std::string &name)
Constructs a Structure with the specified name.
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.
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 bool is_symbol() const override
Structures are not symbolic types.
virtual TypeID type_id() const override
Returns TypeID::Structure.
virtual void replace_symbols(const symbolic::ExpressionMapping &replacements) override
Definition structure.h:106
const std::string & name() const
Gets the name of this structure type.
virtual void replace_symbols(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
Replace symbolic expressions on this type.
Definition structure.h:104
virtual PrimitiveType primitive_type() const override
Returns the primitive type (implementation-defined for structures).
bool is_pointer_like() const override
Checks if this structure behaves like a pointer.
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
SymEngine::RCP< const SymEngine::Integer > Integer
Reference-counted pointer to a SymEngine Integer constant.
Definition symbolic.h:77
SymEngine::map_basic_basic ExpressionMapping
Definition symbolic.h:109
Definition structure.h:23
PrimitiveType
Enumeration of all primitive data types supported by sdfglib.
Definition type.h:35
TypeID
Enumeration of high-level type categories.
Definition type.h:607
Core type system definitions for sdfglib.