Open Search
    CombinerInterface Class Reference

    #include <observable.h>

    Inheritance diagram for CombinerInterface:

    Detailed Description

    Combiners allow to combine the result of multiple observable subscribers. There are some default implementations: see ObservableCombinerRunAllComponent, ObservableCombinerRunAllBoolOrComponent.

    Public Member Functions

    MAXON_METHOD Result< void > InitCombine (Result< Data > &combinedRes) const
     
    MAXON_METHOD Result< BoolCombineResult (Result< Data > &combinedRes, Result< Data > &&newRes) const
     

    Private Member Functions

     MAXON_INTERFACE (CombinerInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.combiner")
     

    Member Function Documentation

    ◆ MAXON_INTERFACE()

    MAXON_INTERFACE ( CombinerInterface  ,
    MAXON_REFERENCE_NORMAL  ,
    "net.maxon.interface.combiner"   
    )
    private

    ◆ InitCombine()

    MAXON_METHOD Result<void> InitCombine ( Result< Data > &  combinedRes) const

    Called first before the observable notification starts. In general the start result value will be copied to the result value.

    Parameters
    [out]combinedResReceives the start value.
    Returns
    OK on success.

    ◆ CombineResult()

    MAXON_METHOD Result<Bool> CombineResult ( Result< Data > &  combinedRes,
    Result< Data > &&  newRes 
    ) const

    Called after each notification. This function defines how the results are combined together. The return value controls if following subscribers should be called.

    Parameters
    [in,out]combinedResContains the last result and receives the new result.
    [in]newResThe new result that needs to be combined with combinedRes.
    Returns
    True if the the next subscriber should be called. False if the notification should stop here.