ObservableImplRef< ObservableClass, DELEGATE > Class Template Reference

#include <observable.h>

Detailed Description

template<typename ObservableClass, typename DELEGATE>
class maxon::ObservableImplRef< ObservableClass, DELEGATE >

Helper template reference class for implementation of observables.

Template Parameters
ObservableClassCan be either ObservableClass or ObservableRPCClass.
DELEGATEDelegate of the observable class defined in the MAXON_OBSERVABLE macro. Usually "Delegate" is appended to the observable name, e.g. ObservableMachineStateChangedDelegate.

Public Member Functions

 ObservableImplRef ()=default
 
 ~ObservableImplRef ()
 
Result< void > Init (ObserverObjectInterface *owner, const Id &observableName)
 
void Free ()
 
ObservableBaseRef InitFirst (const ObserverObjectInterface *owner, const char *observableName) const
 
ObservableRef< DELEGATE > Get (const ObserverObjectInterface *owner, const char *observableName, Bool createOnDemand) const
 
Int GetObserverCount ()
 
template<typename... ARGS>
details::GetResultType< typename DELEGATE::ResultValueType >::resulttype Notify (ARGS &&... args) const
 

Private Attributes

ThreadSafeRef< ObservableBaseRef > _observable
 

Constructor & Destructor Documentation

◆ ObservableImplRef()

ObservableImplRef ( )
default

Default constructor, allocates the object.

◆ ~ObservableImplRef()

Member Function Documentation

◆ Init()

Result<void> Init ( ObserverObjectInterface owner,
const Id observableName 
)

◆ Free()

void Free ( )

◆ InitFirst()

ObservableBaseRef InitFirst ( const ObserverObjectInterface owner,
const char *  observableName 
) const

◆ Get()

ObservableRef<DELEGATE> Get ( const ObserverObjectInterface owner,
const char *  observableName,
Bool  createOnDemand 
) const

◆ GetObserverCount()

Int GetObserverCount ( )

◆ Notify()

details::GetResultType<typename DELEGATE::ResultValueType>::resulttype Notify ( ARGS &&...  args) const

Member Data Documentation

◆ _observable

ThreadSafeRef<ObservableBaseRef> _observable
mutableprivate