|
docc 0.8.3 (0d44999b)
C++ API Reference
|
Represents a function type. More...
#include <sdfg/types/function.h>
Public Member Functions | |
| Function (const IType &return_type, bool is_var_arg=false) | |
| Constructs a Function with the specified return type. | |
| Function (StorageType storage_type, size_t alignment, const std::string &initializer, const IType &return_type, bool is_var_arg=false) | |
| Constructs a Function with explicit storage, alignment, initializer, and return type. | |
| virtual PrimitiveType | primitive_type () const override |
| Returns the primitive type of the return type. | |
| virtual TypeID | type_id () const override |
| Returns TypeID::Function. | |
| virtual bool | is_symbol () const override |
| Functions are not symbolic types. | |
| bool | is_pointer_like () const override |
| Checks if this is a pointer or a structure behaves like a pointer. | |
| size_t | num_params () const |
| Gets the number of parameters. | |
| const IType & | param_type (symbolic::Integer index) const |
| Gets the type of a parameter at the specified index. | |
| void | add_param (const IType ¶m) |
| Adds a parameter to the function signature. | |
| const IType & | return_type () const |
| Gets the return type of the function. | |
| bool | is_var_arg () const |
| Checks if the function accepts variadic arguments. | |
| virtual bool | operator== (const IType &other) const override |
| Compares this function type with another type for equality. | |
| virtual std::unique_ptr< IType > | clone () const override |
| Creates a deep copy of this function type. | |
| virtual std::string | print () const override |
| Returns a string representation of this function 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 function type.
The Function class represents a function signature, including:
Function types are used to represent function pointers, function declarations, and callable objects in the SDFG type system.
| sdfg::types::Function::Function | ( | const IType & | return_type, |
| bool | is_var_arg = false ) |
Constructs a Function with the specified return type.
| return_type | The return type of the function |
| is_var_arg | Whether the function accepts variadic arguments (default: false) |
| sdfg::types::Function::Function | ( | StorageType | storage_type, |
| size_t | alignment, | ||
| const std::string & | initializer, | ||
| const IType & | return_type, | ||
| bool | is_var_arg = false ) |
Constructs a Function with explicit storage, alignment, initializer, and return type.
| storage_type | The storage location and management |
| alignment | Memory alignment in bytes |
| initializer | Optional initializer expression |
| return_type | The return type of the function |
| is_var_arg | Whether the function accepts variadic arguments (default: false) |
| void sdfg::types::Function::add_param | ( | const IType & | param | ) |
Adds a parameter to the function signature.
Parameters are added in order. This method should be called for each parameter in the function signature.
| param | The type of the parameter to add |
|
overridevirtual |
Creates a deep copy of this function type.
Implements sdfg::types::IType.
|
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 |
| bool sdfg::types::Function::is_var_arg | ( | ) | const |
Checks if the function accepts variadic arguments.
| size_t sdfg::types::Function::num_params | ( | ) | const |
Gets the number of parameters.
|
overridevirtual |
Compares this function type with another type for equality.
Implements sdfg::types::IType.
| const IType & sdfg::types::Function::param_type | ( | symbolic::Integer | index | ) | const |
Gets the type of a parameter at the specified index.
| index | The zero-based index of the parameter |
|
overridevirtual |
Returns the primitive type of the return type.
Implements sdfg::types::IType.
|
overridevirtual |
Returns a string representation of this function 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.
| const IType & sdfg::types::Function::return_type | ( | ) | const |
Gets the return type of the function.
|
overridevirtual |
Returns TypeID::Function.
Implements sdfg::types::IType.