[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Classes' (#rtl)

TRecall

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Helper class for storing published properties

Declaration

Source position: classesh.inc line 330

type TRecall = class(TObject)

public

  constructor Create();

  

Creates a new instance of TRecall.

  destructor Destroy; override;

  

Copies the stored properties to the reference object and destroys the TRecallinstance.

  procedure Store;

  

Assigns the reference instance to the storage instance.

  procedure Forget;

  

Clear the reference property.

  property Reference: TPersistent; [r]

  

The reference object.

end;

Inheritance

TRecall

  

Helper class for storing published properties

|

TObject

Description

TRecallis a helper class used to copy published properties of a class (the reference object) in another class (the storage object). The reference object and storage object must be assignable to each other.

The TRecallcan be used to store the state of a persistent class, and restore it at a later time.

When a TRecallobject is created, it gets passed a reference instance and a storage instance. It immediatly stores the properties of the reference object in the storage object.

The Storemethod can be called throughout the lifetime of the reference object to update the stored properties.

When the TRecallinstance is destroyed then the properties are copied from the storage object to the reference object. The storage object is freed automatically.

If the properties should not be copied back from the storage to the reference object, the Forgetcan be called.

See also

TRecall.Create

  

Creates a new instance of TRecall.

TRecall.Destroy

  

Copies the stored properties to the reference object and destroys the TRecallinstance.

TRecall.Forget

  

Clear the reference property.

TRecall.Store

  

Assigns the reference instance to the storage instance.

TPersistent.Assign

  

Assign the contents of one class to another.