TObservedHook class
Observer pattern helper class implementing IFPObserved interface
Declaration
TObservedHook = class(TObject)Inheritance
- TObservedHook
- TObject
Description
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.
See also
- IFPObserver
Properties
Sender | public | Default sender object for notifications |
Methods
CreateSender | public | Creates an observer hook with a specified sender object |
Destroy | public | Destroys the observer hook and notifies all observers |
FPOAttachObserver | public | Attaches an observer implementing IFPObserver interface |
FPODetachObserver | public | Detaches an observer from the notification list |
Changed | public | Notifies all observers that the object has changed |
AddItem | public | Notifies observers that an item was added |
DeleteItem | public | Notifies observers that an item was deleted |
CustomNotify | public | Sends custom notification to all observers |
FPONotifyObservers | public | Core method to notify all observers about operations |
Fields
FObservers | protected | |
FSender | protected |
Inherited
From TObject (41)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance Create DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
