Callback multiplexer. More...
#include <roboptim/core/callback/multiplexer.hh>
Public Types | |
typedef S | solver_t |
Type of the solver. | |
typedef solver_t::problem_t | problem_t |
Type of the problem. | |
typedef SolverState< problem_t > | solverState_t |
Type of the state of the solver. | |
typedef solver_t::callback_t | callback_t |
Callback function type. | |
typedef std::vector< callback_t > | callbacks_t |
Type of a vector of callbacks. | |
Public Member Functions | |
Multiplexer (solver_t &solver) | |
Default constructor containing no callback. | |
Multiplexer (solver_t &solver, const callbacks_t &callbacks) | |
Constructor filling the vector of callbacks. | |
virtual | ~Multiplexer () |
Virtual destructor. | |
callbacks_t & | callbacks () |
Return the vector of callbacks. | |
const callbacks_t & | callbacks () const |
Return the vector of callbacks. | |
Protected Member Functions | |
void | perIterationCallback (const problem_t &pb, solverState_t &state) |
Meta-callback calling multiple callbacks. | |
virtual void | perIterationCallbackUnsafe (const problem_t &pb, solverState_t &state) |
Meta-callback calling multiple callbacks. | |
void | attach () |
Register the multiplexer with the solver. | |
void | unregister () |
Unregister the multiplexer from the solver. |
Callback multiplexer.
This class turns multiple callback functions into one. Note that callbacks are processed in the order of the vector of functions provided. Beware of conflicts between multiple callbacks.
S | solver type. |
typedef solver_t::callback_t roboptim::callback::Multiplexer< S >::callback_t |
Callback function type.
typedef std::vector<callback_t> roboptim::callback::Multiplexer< S >::callbacks_t |
Type of a vector of callbacks.
typedef solver_t::problem_t roboptim::callback::Multiplexer< S >::problem_t |
Type of the problem.
typedef S roboptim::callback::Multiplexer< S >::solver_t |
Type of the solver.
typedef SolverState<problem_t> roboptim::callback::Multiplexer< S >::solverState_t |
Type of the state of the solver.
roboptim::callback::Multiplexer< S >::Multiplexer | ( | solver_t & | solver | ) | [explicit] |
Default constructor containing no callback.
solver | solver the multiplexer will attach to. |
References roboptim::callback::Multiplexer< S >::attach().
roboptim::callback::Multiplexer< S >::Multiplexer | ( | solver_t & | solver, |
const callbacks_t & | callbacks | ||
) | [explicit] |
Constructor filling the vector of callbacks.
solver | solver the multiplexer will attach to. |
callbacks | a vector of callbacks. |
References roboptim::callback::Multiplexer< S >::attach().
roboptim::callback::Multiplexer< S >::~Multiplexer | ( | ) | [virtual] |
Virtual destructor.
void roboptim::callback::Multiplexer< S >::attach | ( | ) | [protected] |
Register the multiplexer with the solver.
References roboptim::bind().
Referenced by roboptim::callback::Multiplexer< S >::Multiplexer().
Multiplexer< S >::callbacks_t & roboptim::callback::Multiplexer< S >::callbacks | ( | ) |
Return the vector of callbacks.
const Multiplexer< S >::callbacks_t & roboptim::callback::Multiplexer< S >::callbacks | ( | ) | const |
Return the vector of callbacks.
void roboptim::callback::Multiplexer< S >::perIterationCallback | ( | const problem_t & | pb, |
solverState_t & | state | ||
) | [protected] |
Meta-callback calling multiple callbacks.
pb | problem. |
state | solver state. |
void roboptim::callback::Multiplexer< S >::perIterationCallbackUnsafe | ( | const problem_t & | pb, |
solverState_t & | state | ||
) | [protected, virtual] |
Meta-callback calling multiple callbacks.
Unsafe version that can throw exceptions.
pb | problem. |
state | solver state. |
void roboptim::callback::Multiplexer< S >::unregister | ( | ) | [protected] |
Unregister the multiplexer from the solver.