10#include "Refureku/TypeInfo/Entity/Entity.h"
11#include "Refureku/TypeInfo/Functions/FunctionParameter.h"
12#include "Refureku/TypeInfo/Functions/ICallable.h"
29 template <
typename ReturnType,
typename... ArgTypes>
47 template <typename... ArgTypes>
92 Type const& type) noexcept;
105 class FunctionBaseImpl;
107 REFUREKU_INTERNAL
FunctionBase(FunctionBaseImpl* implementation) noexcept;
111 RFK_GEN_GET_PIMPL(FunctionBaseImpl,
Entity::getPimpl());
118 template <typename... ArgTypes>
127 template <typename... ArgTypes>
135 template <typename ReturnType>
144 template <typename ReturnType>
145 RFK_NODISCARD
bool hasSameReturnType() const noexcept;
152 template <typename... ArgTypes>
153 RFK_NODISCARD
bool hasSameParametersCount() const noexcept;
160 template <std::
size_t Rank, typename FirstArgType, typename SecondArgType, typename... OtherArgTypes>
161 RFK_NODISCARD
bool hasSameParameterTypes() const noexcept;
162 template <std::
size_t Rank, typename LastArgType>
163 RFK_NODISCARD
bool hasSameParameterTypes() const noexcept;
164 template <typename... ArgTypes>
165 RFK_NODISCARD
bool hasSameParameterTypes() const noexcept;
170 template <std::
size_t Rank, typename FirstArgType, typename SecondArgType, typename... OtherArgTypes>
172 template <std::
size_t Rank, typename LastArgType>
181 RFK_NORETURN REFUREKU_API
void throwArgCountMismatchException(std::
size_t received) const;
189 RFK_NORETURN REFUREKU_API
void throwArgTypeMismatchException(std::
size_t paramIndex) const;
195 RFK_NORETURN REFUREKU_API
void throwReturnTypeMismatchException() const;
198 #include "Refureku/TypeInfo/Functions/FunctionBase.inl"
Definition: FunctionBase.h:17
RFK_NODISCARD REFUREKU_API ICallable * getInternalFunction() const noexcept
Get the internal function handled by this object.
void checkParametersCount() const
Check that the provided argument count is the same as this function's.
REFUREKU_API FunctionParameter & addParameter(char const *name, std::size_t id, Type const &type) noexcept
Add a parameter to the function.
RFK_NODISCARD bool hasSameParameters() const noexcept
RFK_NODISCARD REFUREKU_API Type const & getReturnType() const noexcept
Get the return type of this function.
void checkReturnType() const
Check that the provided type is the same as this function return type.
REFUREKU_API void setParametersCapacity(std::size_t capacity) noexcept
Set the number of parameters for this function. Useful to avoid reallocations when adding a lot of pa...
RFK_NODISCARD REFUREKU_API FunctionParameter const & getParameterAt(std::size_t index) const noexcept
Retrieve the parameter at the given index. If index is greater or equal to the parameters count,...
RFK_NODISCARD bool hasSameSignature() const noexcept
Check whether 2 functions have the same signature. Non reflected types are compared equal,...
void checkParameterTypes() const
Check that the provided types are the same as this function parameter types.
RFK_NODISCARD REFUREKU_API std::size_t getParametersCount() const noexcept
Get the number of parameters of this function.
Definition: FunctionParameter.h:16
Definition: ICallable.h:13
Definition: Allocator.h:16