jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
functional.hpp File Reference
#include <cstring>
#include <string>
#include <memory>
#include <cstdint>
#include <type_traits>
#include <functional>
#include <jau/basic_types.hpp>
#include <jau/cpp_lang_util.hpp>
#include <jau/type_info.hpp>
#include <jau/debug.hpp>
Include dependency graph for functional.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jau::func::final_opt< R, A >
 Delegated target function object, providing a fast path target function invocation. More...
 
struct  jau::func::final_opt< R, A >::final_opt
 C++ conform Pointer to Member Function (PMF) More...
 
class  jau::final_opt< R, A >
 Class template jau::function is a general-purpose static-polymorphic function wrapper. More...
 

Namespaces

namespace  jau
 __pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
 
namespace  jau::func
 

Enumerations

enum class  jau::func::target_type : uint16_t {
  jau::func::target_type::null = 0 , jau::func::target_type::member = 1 , jau::func::target_type::free = 2 , jau::func::target_type::lambda = 3 ,
  jau::func::target_type::ylambda = 4 , jau::func::target_type::capval = 5 , jau::func::target_type::capref = 6 , jau::func::target_type::std = 7 ,
  jau::func::target_type::null = 0 , jau::func::target_type::member = 1 , jau::func::target_type::free = 2 , jau::func::target_type::lambda = 3 ,
  jau::func::target_type::capval = 4 , jau::func::target_type::capref = 5 , jau::func::target_type::std = 6
}
 func::target_type identifier for the target function delegate_t<R, A...> object, exposed by jau::function<R(A...)>::type(). More...
 

Functions

template<typename R, typename I, typename... A>
jau::function< R(A...)> jau::bind_capref (I *data_ptr, R(*func)(I *, A...)) noexcept
 Bind given data by passing the captured reference (pointer) to the value and non-void function to an anonymous function using func::capref_target_t.
 
template<typename I, typename... A>
jau::function< void(A...)> jau::bind_capref (I *data_ptr, void(*func)(I *, A...)) noexcept
 Bind given data by passing the captured reference (pointer) to the value and void function to an anonymous function using func::capref_target_t.
 
template<typename R, typename I, typename... A>
jau::function< R(A...)> jau::bind_capval (const I &data, R(*func)(I &, A...)) noexcept
 Bind given data by copying the captured value and the given non-void function to an anonymous function using func::capval_target_t.
 
template<typename I, typename... A>
jau::function< void(A...)> jau::bind_capval (const I &data, void(*func)(I &, A...)) noexcept
 Bind given data by copying the captured value and the given void function to an anonymous function using func::capval_target_t.
 
template<typename R, typename I, typename... A>
jau::function< R(A...)> jau::bind_capval (I &&data, R(*func)(I &, A...)) noexcept
 Bind given data by moving the captured value and copying the given non-void function to an anonymous function using func::capval_target_t.
 
template<typename I, typename... A>
jau::function< void(A...)> jau::bind_capval (I &&data, void(*func)(I &, A...)) noexcept
 Bind given data by moving the captured value and copying the given void function to an anonymous function using func::capval_target_t.
 
template<typename R, typename... A>
jau::function< R(A...)> jau::bind_free (R(*func)(A...)) noexcept
 Bind given non-void free-function to an anonymous function using func::free_target_t.
 
template<typename... A>
jau::function< void(A...)> jau::bind_free (void(*func)(A...)) noexcept
 Bind given void free-function to an anonymous function using func::free_target_t.
 
template<typename R, typename C, typename... A>
jau::function< R(A...)> jau::bind_member (C *base, R(C::*mfunc)(A...)) noexcept
 Bind given class instance and non-void member function to an anonymous function using func_member_targer_t.
 
template<typename C, typename... A>
jau::function< void(A...)> jau::bind_member (C *base, void(C::*mfunc)(A...)) noexcept
 Bind given class instance and void member function to an anonymous function using func_member_targer_t.
 
template<typename R, typename C0, typename C1, typename... A>
jau::function< R(A...)> jau::bind_member (C1 *base, R(C0::*mfunc)(A...)) noexcept
 Bind given class instance and non-void member function to an anonymous function using func_member_targer_t.
 
template<typename C0, typename C1, typename... A>
jau::function< void(A...)> jau::bind_member (C1 *base, void(C0::*mfunc)(A...)) noexcept
 Bind given class instance and void member function to an anonymous function using func_member_targer_t.
 
template<typename R, typename... A>
jau::function< R(A...)> jau::bind_std (uint64_t id, std::function< R(A...)> func) noexcept
 Bind given non-void std::function to an anonymous function using func::std_target_t.
 
template<typename... A>
jau::function< void(A...)> jau::bind_std (uint64_t id, std::function< void(A...)> func) noexcept
 Bind given void std::function to an anonymous function using func::std_target_t.
 
constexpr uint32_t jau::number (const func::target_type rhs) noexcept
 
template<class R, class... A>
bool jau::operator!= (const function< R(A...)> &lhs, std::nullptr_t) noexcept
 Unequal operator of jau::function<R(A...)> with a right-hand-side nullptr.
 
template<typename Rl, typename... Al, template< typename... > typename Fl = function, typename Rr, typename... Ar, template< typename... > typename Fr = function>
bool jau::operator!= (const function< Rl(Al...)> &lhs, const function< Rr(Ar...)> &rhs) noexcept
 Unequal operator using two jau::function<R(A...)> types for both arguments.
 
template<class R, class... A>
bool jau::operator!= (std::nullptr_t, const function< R(A...)> &rhs) noexcept
 Unequal operator of jau::function<R(A...)> with a left-hand-side nullptr.
 
template<class R, class... A>
bool jau::operator== (const function< R(A...)> &lhs, std::nullptr_t) noexcept
 Equal operator of jau::function<R(A...)> with a right-hand-side nullptr.
 
template<typename Rl, typename... Al, template< typename... > class Fl = function, typename Rr, typename... Ar, template< typename... > class Fr = function, std::enable_if_t< !std::is_same_v< Fl< Rl(Al...)>, Fr< Rr(Ar...)> >, bool > = true>
bool jau::operator== (const function< Rl(Al...)> &lhs, const function< Rr(Ar...)> &rhs) noexcept
 Equal operator using different jau::function<R(A...)> return and argument types for both arguments, always returns false.
 
template<class R, class... A>
bool jau::operator== (std::nullptr_t, const function< R(A...)> &rhs) noexcept
 Equal operator of jau::function<R(A...)> with a left-hand-side nullptr.
 
std::string jau::to_string (const func::target_type v) noexcept