Skip to content
Snippets Groups Projects
Forked from Alchemy Viewer / Alchemy Viewer
Source project has a limited visibility.
  • Nat Goodspeed's avatar
    2c894ecb
    DRTVWR-558: Extend LLEventDispatcher::add() overloads. · 2c894ecb
    Nat Goodspeed authored
    Add LL::always_return<T>(), which takes a callable and variadic arguments. It
    calls the callable with those arguments and, if the returned type is
    convertible to T, converts it and returns it. Otherwise it returns T().
    always_return() is generalized from, and supersedes,
    LLEventDispatcher::ReturnLLSD.
    
    Add LL::function_arity<CALLABLE>, which extends
    boost::function_types::function_arity by reporting results for both
    std::function<CALLABLE> and boost::function<CALLABLE>. Use for
    LL::apply(function, LLSD array) as well as for LLEventDispatcher.
    
    Make LLEventDispatcher::add() overloads uniformly distinguish between a
    callable (whether non-static member function or otherwise) that accepts a
    single LLSD parameter, versus any other signature. Accepting exactly one LLSD
    parameter signals that the callable will accept the composite arguments LLSD
    blob, instead of asking LLEventDispatcher to unpack the arguments blob into
    individual arguments.
    
    Support add(subclass method) overloads for arbitrary-parameters methods as
    well as for (const LLSD&) methods. Update tests accordingly: we need no longer
    pass the boilerplate lambda instance getter that binds and returns 'this'.
    
    Extract to the two LLEventDispatcher::make_invoker() overloads the LL::apply()
    logic formerly found in ReturnLLSD.
    
    Change lleventdispatcher_test.cpp tests from boost::bind(), which accepts
    variadic arguments (even though it only passes a fixed set to the target
    callable), to fixed-signature lambdas. This is because the revamped add()
    overloads care about signature.
    
    Add a test for a non-static method that accepts (const LLSD&), in other words
    the composite arguments LLSD blob, and likewise returns LLSD.
    
    (cherry picked from commit 95b787f7d7226ee9de79dfc9816f33c8bf199aad)
    2c894ecb
    History
    DRTVWR-558: Extend LLEventDispatcher::add() overloads.
    Nat Goodspeed authored
    Add LL::always_return<T>(), which takes a callable and variadic arguments. It
    calls the callable with those arguments and, if the returned type is
    convertible to T, converts it and returns it. Otherwise it returns T().
    always_return() is generalized from, and supersedes,
    LLEventDispatcher::ReturnLLSD.
    
    Add LL::function_arity<CALLABLE>, which extends
    boost::function_types::function_arity by reporting results for both
    std::function<CALLABLE> and boost::function<CALLABLE>. Use for
    LL::apply(function, LLSD array) as well as for LLEventDispatcher.
    
    Make LLEventDispatcher::add() overloads uniformly distinguish between a
    callable (whether non-static member function or otherwise) that accepts a
    single LLSD parameter, versus any other signature. Accepting exactly one LLSD
    parameter signals that the callable will accept the composite arguments LLSD
    blob, instead of asking LLEventDispatcher to unpack the arguments blob into
    individual arguments.
    
    Support add(subclass method) overloads for arbitrary-parameters methods as
    well as for (const LLSD&) methods. Update tests accordingly: we need no longer
    pass the boilerplate lambda instance getter that binds and returns 'this'.
    
    Extract to the two LLEventDispatcher::make_invoker() overloads the LL::apply()
    logic formerly found in ReturnLLSD.
    
    Change lleventdispatcher_test.cpp tests from boost::bind(), which accepts
    variadic arguments (even though it only passes a fixed set to the target
    callable), to fixed-signature lambdas. This is because the revamped add()
    overloads care about signature.
    
    Add a test for a non-static method that accepts (const LLSD&), in other words
    the composite arguments LLSD blob, and likewise returns LLSD.
    
    (cherry picked from commit 95b787f7d7226ee9de79dfc9816f33c8bf199aad)
Code owners
Assign users and groups as approvers for specific file changes. Learn more.