-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
To subscribe to an observable this can be done by creating a class that implements IObserver and subscibe.
However, it is not possible to unsubscribe. When subscribing a reference should be returned so that an observer can unsubscribe.
The IObserver *_observer; should be iterable, so become a list/array and all the observers should be called.
See, for example the Observable base:
- Subscibe does not return a reference, but void.
- The _observer is only a single observer. but should be some list.
template <typename T>
class ObservableProperty : public Observable<T>
{
public:
void operator = (const T&);
ObservableProperty();
void Subscribe(IObserver<T> &) override;
void Finish();
void Reset() override;
private:
IObserver<T> *_observer;
bool _complete = false;
};
Metadata
Metadata
Assignees
Labels
No labels