Friendly LWM2M client
wpp::ObjSubject Class Reference

The ObjSubject class represents a subject that notifies observers about object operations and actions. More...

#include <ObjSubject.h>

+ Inheritance diagram for wpp::ObjSubject:
+ Collaboration diagram for wpp::ObjSubject:

Public Member Functions

void opSubscribe (ObjOpObserver *observer)
 Subscribes an observer to receive notifications about object operations. More...
 
void opUnsubscribe (ObjOpObserver *observer)
 Unsubscribes an observer from receiving notifications about object operations. More...
 

Protected Member Functions

void operationNotify (Object &obj, ID_T instanceId, ItemOp::TYPE type)
 Notifies observers about object operations. More...
 

Detailed Description

The ObjSubject class represents a subject that notifies observers about object operations and actions.

This class provides functionality for subscribing and unsubscribing observers to receive notifications about the creation and deletion of object instances initiated by the server, as well as required restore actions for objects.

The ObjSubject class is designed to be inherited by other classes that require observer functionality.

Note
The ObjSubject class requires the presence of ObjOpObserver and ObjActObserver classes for observer functionality.

Definition at line 21 of file ObjSubject.h.

Member Function Documentation

◆ operationNotify()

void wpp::ObjSubject::operationNotify ( Object obj,
ID_T  instanceId,
ItemOp::TYPE  type 
)
inlineprotected

Notifies observers about object operations.

This function is called to notify the subscribed observers about the creation and deletion of object instances.

Parameters
objThe Object instance that the operation is performed on.
instanceIdThe ID of the object instance.
typeThe type of operation (CREATE or DELETE).

Definition at line 53 of file ObjSubject.h.

+ Here is the caller graph for this function:

◆ opSubscribe()

void wpp::ObjSubject::opSubscribe ( ObjOpObserver observer)
inline

Subscribes an observer to receive notifications about object operations.

Parameters
observerA pointer to the ObjOpObserver object to be subscribed.

Definition at line 28 of file ObjSubject.h.

◆ opUnsubscribe()

void wpp::ObjSubject::opUnsubscribe ( ObjOpObserver observer)
inline

Unsubscribes an observer from receiving notifications about object operations.

Parameters
observerA pointer to the ObjOpObserver object to be unsubscribed.

Definition at line 39 of file ObjSubject.h.