observable.h File Reference

Classes

struct  Undefined
 
class  CallMe< T >
 
class  CallMe< void >
 
class  CallMe< Result< T > >
 
class  CallMe< Result< void > >
 
class  UnpackConstData< RESULT(ARGS...)>
 
class  PackConstData< ARGS >
 
struct  GetResultType< T >
 
struct  GetResultType< Data >
 
struct  GetResultType< void >
 
struct  GetResultType< Result< T > >
 
struct  GetResultType< Result< Data > >
 
struct  GetResultType< Result< void > >
 
class  FunctionBaseInterface
 
class  CombinerInterface
 
class  ObservableBaseInterface
 
class  ObservableNotifyRef< Delegate< RESULT(void)> >
 
class  ObservableNotifyRef< Delegate< RESULT(ARGS...)> >
 
class  ObservableRef< DELEGATE >
 
class  ObservableStaticInterface
 
class  ObservableImplRef< ObservableClass, DELEGATE >
 

Namespaces

 maxon
 
 maxon::details
 

Macros

#define PRIVATE_MAXON_OBSERVABLE_IMPL(NAME, Interface)
 
#define PRIVATE_MAXON_OBSERVABLE_IMPL_
 
#define MAXON_OBSERVABLE_IMPL(NAME, ...)
 
#define OBSERVABLE_IMPL_NONVIRTUAL(NAME)
 
#define MAXON_OBSERVABLE(RETTYPE, NAME, ...)
 
#define MAXON_OBSERVABLE_STATIC(RETTYPE, NAME, ...)
 

Typedefs

using ObservableForwardFunction = Result< Data >(*)(const DelegateBase &observerFunction, const Block< const ConstDataPtr > &data)
 
using FunctionBaseWeakRef = WeakRef< FunctionBaseRef >
 

Functions

template<typename... ARGS>
static auto GetUnpackConstData (const Delegate< ARGS... > &) -> UnpackConstData< ARGS... >
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllComponent, "net.maxon.component.observablecombinerrunall")
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllBoolOrComponent, "net.maxon.component.observablecombinerrunallboolor")
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllBoolUntilFalse, "net.maxon.component.observablecombinerrunallbooluntilfalse")
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllBoolUntilTrue, "net.maxon.component.observablecombinerrunallbooluntiltrue")
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllEnumFlagsOrComponent, "net.maxon.component.observablecombinerrunallenumflagsor")
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllEnumFlags64OrComponent, "net.maxon.component.observablecombinerrunallenumflags64or")
 
 MAXON_DECLARATION (ComponentDescriptor, ObservableCombinerRunAllAggregateErrorsComponent, "net.maxon.component.observablecombinerrunallaggregateerrors")
 
 MAXON_DECLARATION (Class< FunctionBaseRef >, FunctionBaseClass, "net.maxon.class.functionbase")
 
 MAXON_DECLARATION (Class< ObservableBaseRef >, ObservableClass, "net.maxon.class.observable")
 

Variables

static constexpr Int ADDOBSERVER_DEFAULTPRIORITY
 

Macro Definition Documentation

◆ PRIVATE_MAXON_OBSERVABLE_IMPL

#define PRIVATE_MAXON_OBSERVABLE_IMPL (   NAME,
  Interface 
)

◆ PRIVATE_MAXON_OBSERVABLE_IMPL_

#define PRIVATE_MAXON_OBSERVABLE_IMPL_

◆ MAXON_OBSERVABLE_IMPL

#define MAXON_OBSERVABLE_IMPL (   NAME,
  ... 
)

Macro for observable implementation. Use MAXON_OBSERVABLE_IMPL(observableName) within the implementation of interfaces which offer observables.

Parameters
[in]NAMEName of the observable in the interface class.
[in]...Optional: The interface of NAME. You need to specify this when the component doesn't implement exactly the interface of NAME, but e.g. a derived interface or additional interfaces.
Example usage:
class NetworkZeroConfBonjourBrowserImpl : public Component<NetworkZeroConfBonjourBrowserImpl, NetworkZeroConfBrowserInterface>
{
public:
Result<void> InitComponent()
{
iferr (_ObservableDetected.Init(self, Id("ObservableDetected")))
return err;
iferr (_ObservableResolved.Init(self, Id("ObservableResolved")))
return err;
return true;
}
void FreeComponent()
{
_ObservableDetected.Free();
_ObservableResolved.Free();
}
MAXON_OBSERVABLE_IMPL(ObservableDetected);
MAXON_OBSERVABLE_IMPL(ObservableResolved);
};
ComponentWithBase< C, ComponentRoot, INTERFACES... > Component
Definition: objectbase.h:2794
#define iferr(...)
Definition: errorbase.h:388
#define MAXON_COMPONENT(KIND,...)
Definition: objectbase.h:2212
#define MAXON_OBSERVABLE_IMPL(NAME,...)
Definition: observable.h:255

◆ OBSERVABLE_IMPL_NONVIRTUAL

#define OBSERVABLE_IMPL_NONVIRTUAL (   NAME)

Macro for observable implementation in non-virtual interfaces.

Parameters
[in]NAMEName of the observable in the interface class.
Example usage:
class TimerImpl : public TimerInterface
{
public:
TimerImpl()
{
_notificationObject = ObserverObjectClass().Create().GetPointer();
_ObservableTimerStarted.Init(_notificationObject, Id("ObservableTimerStarted"));
}
~TimerImpl()
{
_ObservableTimerStarted.Free();
}
void Start()
{
_ObservableTimerStarted.Notify();
}
OBSERVABLE_IMPL_NONVIRTUAL(ObservableTimerStarted);
private:
ObserverObjectRef _notificationObject;
};
#define MAXON_IMPLEMENTATION(C)
Definition: interfacebase.h:1467
#define OBSERVABLE_IMPL_NONVIRTUAL(NAME)
Definition: observable.h:290

◆ MAXON_OBSERVABLE

#define MAXON_OBSERVABLE (   RETTYPE,
  NAME,
  ... 
)

Defined Observables for the source processor.

◆ MAXON_OBSERVABLE_STATIC

#define MAXON_OBSERVABLE_STATIC (   RETTYPE,
  NAME,
  ... 
)