-
首页
-
C4D R23.110 C++ SDK
ObservableBaseInterface Class Reference
#include <observable.h>
详细描述
Base Observable
Class
that allows to add subscribers to observables. Never use this directly, instead use ObservableRef<>.
成员函数文档编制
◆
MAXON_INTERFACE()
◆
Init()
This function needs to be called in the implementation InitComponent() function.
-
参数
-
[in]
|
owner
|
Pointer to the observable owner.
|
[in]
|
observableName
|
Name of the observable. This observable name is sent via ObserverConnectNotify/ObserverDisconnectNotify.
|
-
返回
-
True if the function operates successful.
◆
GetObservableId()
This function returns the
Id
given in the Init function.
◆
_intDisconnectAll()
This function needs to be called in the implementation FreeComponent() function. Don't use this function directly, only for internal use!
-
参数
-
[in]
|
observer
|
Nullptr if all observables should be disconnected. If a object is given only this specific observables are disconnected.
|
[in]
|
pass
|
Internal use only.
|
◆
Disconnect()
This function needs to be called in the implementation FreeComponent() function.
-
参数
-
[in]
|
observer
|
Nullptr if all observables should be disconnected. If a object is given only this specific observables are disconnected.
|
◆
Free()
This function needs to be called in the implementation FreeComponent() function.
◆
AddObserver()
Add a subscriber to the observable. Notes: the implementation need to take the ownership of the observerFunction only if the function succeeds. in the case of an error (returning nullptr) the wrapper class outside frees the memory!
-
参数
-
[in]
|
observer
|
Pointer to a observer object. This parameter can be nullptr.
|
[in]
|
observerFunction
|
Function object that is stored with in the observable.
|
[in]
|
priority
|
Priority in execution. Use ADDOBSERVER_DEFAULTPRIORITY as default. Greater values will execute later.
|
-
返回
-
OK on success.
◆
Notify()
Send a notification to all subscribers.
-
参数
-
[in]
|
args
|
Arguments packed into a Block<ConstDataPtr>.
|
-
返回
-
The combined result of the observable. See
CombinerInterface
.
◆
RemoveObserver()
Remove a observable entry from the subscriber list.
-
参数
-
[in]
|
observerEntry
|
Entry to remove.
|
-
返回
-
OK on success.
◆
SetInverseNotification()
Set true to
Notify()
in inverse order.
◆
GetObserverCount()
Gets the number of observers.
-
返回
-
The number of observers.
◆
GetOwner()
Gets the owner of the observable.
-
返回
-
The owner of the observable.