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 ( CombinerInterface  ,

◆ 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.

[out]combinedResReceives the start value.
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.

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