5template <
typename TReturn,
typename... TArgs>
6template <
typename TCallable>
12 if constexpr (is_derived_from_function_type<TCallable>::value)
14 id = callable.GetID();
15 name = callable.GetName();
25 Log::Warning(fmt::format(
"Function already exists: {}", name));
29 auto function = std::make_unique<
CallableFunction<TCallable, TReturn, TArgs...>>(callable);
38template <
typename TReturn,
typename... TArgs>
46 Log::Warning(
"Function already exists: " + function->GetName());
58template <
typename TReturn,
typename... TArgs>
69 auto listIt = mapIt->second;
70 auto func = std::move(*listIt);
Base class for all functions contained in a FunctionContainer.
Definition BaseFunction.hpp:10
Abstract class that holds a callable object, to be later stored in a container.
Definition CallableFunction.hpp:13
static FunctionID GetCallableID(TCallable callable)
Get the ID of the callable object.
Definition CallableFunction.hpp:55
static std::string GetCallableName(TCallable callable)
Definition CallableFunction.hpp:67
Container for functions, allowing for dynamic storage and invocation.
Definition FunctionContainer.hpp:14
FunctionID AddFunction(TCallable callable)
Adds a function to the container.
std::unordered_map< FunctionID, typename std::list< std::unique_ptr< FunctionType > >::iterator > _idToIterator
Definition FunctionContainer.hpp:113
std::unique_ptr< FunctionType > DeleteFunction(FunctionID id)
Deletes a function from the container.
Definition FunctionContainer.inl:60
std::list< std::unique_ptr< FunctionType > > _orderedFunctions
Definition FunctionContainer.hpp:111
std::size_t FunctionID
FunctionID class to represent a unique identifier for functions.
Definition FunctionID.hpp:9
void Warning(const T &msg) noexcept
Definition Logger.hpp:49