About
An implementation of an interface that declares an observable must implement the behaviour of the observable. The observable must be initiated, freed and invoked.
Implementation
To implement basic observable functionality an implementation must include a maxon::ObserverObjectClass object with MAXON_COMPONENT().
The observable declared with MAXON_OBSERVABLE() is available as a member variable with the defined name and a "_" prefix.
class ObserveMeImpl :
public maxon::Component<ObserveMeImpl, ObserveMeInterface>
{
public:
{
_count = 0;
}
void FreeComponent()
{
_ObservablePing.Free();
}
{
++_count;
iferr (_ObservablePing.Notify(_count))
{
}
}
private:
};
Definition: objectbase.h:2651
Definition: apibaseid.h:253
int32_t Int32
32 bit signed integer datatype.
Definition: apibase.h:176
return OK
Definition: apibase.h:2690
@ NORMAL
Samples the surface as the user moves over it the SculptObject and returns a new hit point and normal...
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:176
#define iferr(...)
Definition: errorbase.h:388
#define MAXON_COMPONENT(KIND,...)
Definition: objectbase.h:2212
#define MAXON_METHOD
Definition: interfacebase.h:1001
#define MAXON_OBSERVABLE_IMPL(NAME,...)
Definition: observable.h:255
#define iferr_scope
Definition: resultbase.h:1384
#define iferr_return
Definition: resultbase.h:1519
The observable must be implemented using MAXON_OBSERVABLE_IMPL().
ObservableBaseInterface
Observables are based on maxon::ObservableBaseInterface:
Subscriber notification:
Observers are handled with:
Further Reading