Skip to content

TPersistent

Base class for streaming system and persistent properties.

Declaration

Source position: classesh.inc line 827

type

  TPersistent = class(TObject, IFPObserved)
  public
    destructor Destroy;
    procedure Assign;
    procedure FPOAttachObserver;
    procedure FPODetachObserver;
    procedure FPONotifyObservers;
    function GetNamePath : string;
  end;

Inheritance

Implements: IFPObserved

Description

TPersistent is the basic class for the streaming system. Since it is compiled in the {$M+} state, the compiler generates RTTI (Run-Time Type Information) for it and all classes that descend from it. This information can be used to stream all properties of classes.

It also introduces functionality to assign the contents of 2 classes to each other.

TPersistent implements the IFPObserved interface for the benefit of descendant classes, but does not call IFPObserved.FPONotifyObservers. Descendants such as TStrings and TCollection and TCollectionItem do use it.

Methods

Member Visibility Description
Assign public Assign the contents of one class to another.
Destroy public Destroys the TPersistent instance.
FPOAttachObserver public Add an observer to the list of observers.
FPODetachObserver public Remove an observer from the list of observers.
FPONotifyObservers public Notify observers of changes.
GetNamePath public Returns a string that can be used to identify the class instance.
See all Methods

See also

Name Description
TComponent Base class for all components that need owner-owned functionality.
IFPObserved Interface implemented by an object that can be observed.
TStrings Class to manage arrays or collections of strings.
TCollection Base class to manage collections of named objects.
TCollectionItem Basic object that is managed by a TCollection class.