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

TPersistent.DefineProperties

Declare non-published properties that need to be streamed.

Declaration

Source position: classesh.inc line 385

protected procedure TPersistent.DefineProperties(

  Filer: TFiler

); virtual;

Description

DefineProperties must be overridden by descendent classes to indicate to the streaming system which non-published properties must also be streamed.

The streaming systems stores only published properties in the stream. Sometimes it is necessary to store additional data in the stream, data which is not published. This can be done by overriding the DefineProperties method. The Filer object is the class that is responsible for writing all properties to the stream.

To define new properties, two methods of the TFiler class should be used:

  1. DefineProperty, to define a property which can be represented as text.
  2. DefineProperty, to define a property which contains binary data.

On order for the streaming to work correctly, a call to the inherited DefineProperties is also needed, so ancestor objects also get the possibility to read or write their private data to the stream. Failure to call the inherited method will result in component properties not being streamed correctly.

See also

TFiler.DefineProperties

TFiler

  

Class responsible for streaming of components.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.