version 0.4.4
Ikarus::NonlinearSolverBase< F, Args > Struct Template Reference

Base for all nonlinear solvers. Defines the message interface that can be broadcasted to listeners. More...

#include <ikarus/solver/nonlinearsolver/nonlinearsolverbase.hh>

Inheritance diagram for Ikarus::NonlinearSolverBase< F, Args >:
[legend]

Public Types

using State = NonlinearSolverStateType< F >
 
using MessageType = NonLinearSolverMessages
 
using Callback = std::function< void(NonLinearSolverMessages, const State &)>
 
using Token = std::shared_ptr< Callback >
 

Public Member Functions

Token registerListener (Callback callback)
 This method is used to register a Listener function. More...
 
void unregisterListener (Token token)
 deregisters a specific function More...
 
void notify (NonLinearSolverMessages message, const State &data)
 This calls all the registered functions. More...
 

Detailed Description

template<typename F, typename... Args>
struct Ikarus::NonlinearSolverBase< F, Args >
Template Parameters
FType of the differentiable function to solve.
ArgsAdditional message signatures can be broadcasted

Member Typedef Documentation

◆ Callback

using Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::Callback = std::function<void(NonLinearSolverMessages , const State&)>
inherited

◆ MessageType

◆ State

template<typename F , typename... Args>
using Ikarus::NonlinearSolverBase< F, Args >::State = NonlinearSolverStateType<F>

◆ Token

using Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::Token = std::shared_ptr<Callback>
inherited

Member Function Documentation

◆ notify()

void Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::notify ( NonLinearSolverMessages  message,
const State data 
)
inlineinherited

◆ registerListener()

Token Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::registerListener ( Callback  callback)
inlineinherited

The function that is passed in is first stored in a shared_ptr. After this, the shared_ptr is added to the vector of listener functions, which leads to a implicit conversion to a weak_ptr. The shared_ptr is then returned to the Listener that has called this function to be stored in a vector of shared_ptr<void> listener.hh.

Parameters
callbackthe callback function
Returns
Token

◆ unregisterListener()

void Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::unregisterListener ( Token  token)
inlineinherited

The documentation for this struct was generated from the following file: