Sign in Join
FPDoc Onlineexperiment

IFPObserved.FPOAttachObserver procedure

Member of IFPObservedIn unit Classes

Attach a new observer to the object.

Declaration

pascal
procedure FPOAttachObserver(AObserver: TObject)

Description

FPOAttachObserver must be called with an object instance AObserver that implements the IFPObserver interface. The FPOObservedChanged method of the interface will be called whenever FPONotifyObservers is used to notify observers of a change. Objects implementing this interface should check that AObserver actually implements the IFPObserver interface.

Do not make assumptions on how the interface behaves if FPOAttachObserver is called more than once with the same interface. It may add the object to the list of observers unconditionally (in which case it will be notified twice) or it may check that it is not yet in the list.

Errors

If AObserver does not implement the IFPObserver interface, an EObserver exception must be raised. No other errors should be raised, other than a possible out of memory error.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.