Callback multiplexer. More...
#include <roboptim/core/callback/multiplexer.hh>
Public Types | |
typedef SolverCallback< S > | parent_t |
Parent type. | |
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 SolverCallback< S > | solverCallback_t |
Solver callback type. | |
typedef boost::shared_ptr < solverCallback_t > | solverCallbackPtr_t |
Pointer to a callback. | |
typedef std::vector < solverCallbackPtr_t > | solverCallbacks_t |
Type of a vector of callbacks. | |
Public Member Functions | |
Multiplexer (solver_t &solver) | |
Default constructor containing no callback. | |
Multiplexer (solver_t &solver, const solverCallbacks_t &callbacks) | |
Constructor filling the vector of callbacks. | |
virtual | ~Multiplexer () |
Virtual destructor. | |
solverCallbacks_t & | callbacks () |
Return the vector of callbacks. | |
const solverCallbacks_t & | callbacks () const |
Return the vector of callbacks. | |
virtual std::ostream & | print (std::ostream &o) const |
Display the callback on the specified output stream. | |
Protected Member Functions | |
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 SolverCallback<S> roboptim::callback::Multiplexer< S >::parent_t |
Parent type.
typedef solver_t::problem_t roboptim::callback::Multiplexer< S >::problem_t |
Type of the problem.
Reimplemented from roboptim::SolverCallback< S >.
typedef S roboptim::callback::Multiplexer< S >::solver_t |
Type of the solver.
Reimplemented from roboptim::SolverCallback< S >.
typedef SolverCallback<S> roboptim::callback::Multiplexer< S >::solverCallback_t |
Solver callback type.
typedef boost::shared_ptr<solverCallback_t> roboptim::callback::Multiplexer< S >::solverCallbackPtr_t |
Pointer to a callback.
typedef std::vector<solverCallbackPtr_t> roboptim::callback::Multiplexer< S >::solverCallbacks_t |
Type of a vector of callbacks.
typedef SolverState<problem_t> roboptim::callback::Multiplexer< S >::solverState_t |
Type of the state of the solver.
Reimplemented from roboptim::SolverCallback< S >.
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 solverCallbacks_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 >::solverCallbacks_t & roboptim::callback::Multiplexer< S >::callbacks | ( | ) |
Return the vector of callbacks.
const Multiplexer< S >::solverCallbacks_t & roboptim::callback::Multiplexer< S >::callbacks | ( | ) | const |
Return the vector of callbacks.
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. |
std::ostream & roboptim::callback::Multiplexer< S >::print | ( | std::ostream & | o | ) | const [virtual] |
Display the callback on the specified output stream.
o | output stream used for display. |
Reimplemented from roboptim::SolverCallback< S >.
References roboptim::decindent(), roboptim::iendl(), and roboptim::incindent().
void roboptim::callback::Multiplexer< S >::unregister | ( | ) | [protected] |
Unregister the multiplexer from the solver.