diff --git a/include/Nazara/Core/Functor.hpp b/include/Nazara/Core/Functor.hpp index 994ecc5ae..7ce9995a7 100644 --- a/include/Nazara/Core/Functor.hpp +++ b/include/Nazara/Core/Functor.hpp @@ -9,7 +9,7 @@ #include -// Inspiré du code de la SFML par Laurent Gomila +// Inspired from the of code of the SFML by Laurent Gomila namespace Nz { diff --git a/include/Nazara/Core/Functor.inl b/include/Nazara/Core/Functor.inl index 84ea8e76f..96c22b175 100644 --- a/include/Nazara/Core/Functor.inl +++ b/include/Nazara/Core/Functor.inl @@ -6,18 +6,40 @@ namespace Nz { + /*! + * \class Nz::StdLogger + * \brief Core class that represents a functor + */ + + /*! + * \brief Constructs a FunctorWithoutArgs object with a function + * + * \param func Function to execute + */ + template FunctorWithoutArgs::FunctorWithoutArgs(F func) : m_func(func) { } + /*! + * \brief Runs the function + */ + template void FunctorWithoutArgs::Run() { m_func(); } + /*! + * \brief Constructs a FunctorWithoutArgs object with a function and its arguments + * + * \param func Function to execute + * \param args Arguments for the function + */ + template FunctorWithArgs::FunctorWithArgs(F func, Args&&... args) : m_func(func), @@ -25,12 +47,22 @@ namespace Nz { } + /*! + * \brief Runs the function + */ + template void FunctorWithArgs::Run() { Apply(m_func, m_args); } + /*! + * \brief Constructs a FunctorWithoutArgs object with a member function and an object + * + * \param func Member function to execute + * \param object Object to execute on + */ template MemberWithoutArgs::MemberWithoutArgs(void (C::*func)(), C* object) : @@ -39,6 +71,10 @@ namespace Nz { } + /*! + * \brief Runs the function + */ + template void MemberWithoutArgs::Run() {