1 #ifndef WPP_INST_SUBJECT_H_
2 #define WPP_INST_SUBJECT_H_
31 if (!observer)
return;
32 if (std::find(_opObservers.begin(), _opObservers.end(), observer) == _opObservers.end())
33 _opObservers.push_back(observer);
42 _opObservers.erase(std::find(_opObservers.begin(), _opObservers.end(), observer));
53 if (!observer)
return;
54 if (std::find(_eventObservers.begin(), _eventObservers.end(), observer) == _eventObservers.end())
55 _eventObservers.push_back(observer);
64 _eventObservers.erase(std::find(_eventObservers.begin(), _eventObservers.end(), observer));
82 observer->resourceWrite(inst, resLink);
85 observer->resourceExecute(inst, resLink);
101 for(
InstEventObserver *observer : _eventObservers) observer->instEvent(inst, eventId);
105 std::vector<InstOpObserver*> _opObservers;
106 std::vector<InstEventObserver*> _eventObservers;
The InstEventObserver class is an abstract base class that defines the interface for observing instan...
The InstOpObserver class is an abstract base class that defines the interface for observing instance ...
The InstSubject class represents a subject that allows subscribers to be notified about various event...
void eventSubscribe(InstEventObserver *observer)
Subscribes an observer to receive notifications about custom instance events.
void opUnsubscribe(InstOpObserver *observer)
Unsubscribes an observer from receiving notifications about instance resource operations.
void opSubscribe(InstOpObserver *observer)
Subscribes an observer to receive notifications about instance resource operations.
void operationNotify(Instance &inst, const ResLink &resLink, ItemOp::TYPE type)
Notifies the observers about an operation on an instance resource.
void eventNotify(Instance &inst, EVENT_ID_T eventId)
Notifies the observers about a custom instance event.
void eventUnsubscribe(InstEventObserver *observer)
Unsubscribes an observer from receiving notifications about custom instance events.
Instance is interface class that implements manipulation with derived class resources....
The WppConnection class represents a connection interface for the Wpp library.
TYPE
Enum representing the different types of operations.