[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Observer pattern helper class implementing IFPObserved interface
Source position: fpobserver.pp line 33
type TObservedHook = class(TObject,IFPObserved) |
||
public |
||
constructor CreateSender(); |
|
Creates an observer hook with a specified sender object |
destructor Destroy; override; |
|
Destroys the observer hook and notifies all observers |
procedure FPOAttachObserver(); |
|
Attaches an observer implementing IFPObserver interface |
procedure FPODetachObserver(); |
|
Detaches an observer from the notification list |
procedure Changed; |
|
Notifies all observers that the object has changed |
procedure AddItem(); |
|
Notifies observers that an item was added |
procedure DeleteItem(); |
|
Notifies observers that an item was deleted |
procedure CustomNotify(); |
|
Sends custom notification to all observers |
procedure FPONotifyObservers(); |
|
Core method to notify all observers about operations |
|
Default sender object for notifications |
|
end; |
|
Observer pattern helper class implementing IFPObserved interface |
|
| | | ||
The TObservedHook class provides a simple way to add observer pattern support to any object. It implements the IFPObserved interface and manages a list of observers that implement the IFPObserver interface.
Objects can use this class as a helper to notify observers about changes, item additions, deletions, or custom events. The class handles attaching and detaching observers automatically and provides methods for different types of notifications.
This class is intended to be used as a component within other classes that need to support observation, rather than being used directly as a standalone object.