TDADataStreamer

Overview

Data Streamers perform the task of reading and writing data and delta packets from and to a format that can be transmitted over the network between client and server. As such they form a critical part of the Data Abstract architecture.

TDADataStreamer is the abstract base class on top of which the actual streamers, such as the TDABinDataStreamer, TDABin2DataStreamer,TDAXmlDataStreamer and TDAJSONDataStreamer are implemented.

While the TDADataStreamer exposes several public properties and methods, you will not usually work with data streamers directly, as the Data Abstract infrastructure (such as the TDataAbstractService, TDABusinessProcessor and TDARemoteDataAdapter classes) will handle the use of the streamers.

Location

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

AdapterInitialization  protected

Defines what for the streamer is initialized.

property AdapterInitialization: TDAAdapterInitialization read write

AddingDataset  protected

This method is used internally when dataset is written in the stream. Adds name of aDatasetName dataset and DatasetInfoObjects for it in the list of datasets that are written in the stream.

procedure AddingDataset(const aDatasetName: string; InfoObject: TObject)

Parameters:

  • aDatasetName: Name of dataset that is written in the stream and added in the list of datasets
  • InfoObject: DatasetInfoObjects that is added in the internally used list of datasets

AddingDelta  protected

This method is used internally when delta is written in the stream. Adds name of aDeltaName delta and DeltaInfoObjects for it in the list of deltas that are written in the stream.

procedure AddingDelta(const aDeltaName: string; InfoObject: TObject)

Parameters:

  • aDeltaName: Name of delta that is written in the stream and added in the list of deltas
  • InfoObject: DeltaInfoObjects that is added in the internally used list of deltas

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

BeginWriteDataset

Calls descedant's implementation of DoBeginWriteDataset

function BeginWriteDataset(const Source: IDADataset; const Schema: TDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): TDADataForAppend

Parameters:

  • Source: dataset that should be written in the data streamer
  • Schema: dataset that should be written in the data streamer. If it is nil then Source datase will be written
  • Options: specifies what should be written in the streamer: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of fields that should be written

BufferSize

Specifies the default buffer size which will be allocated for operations.

property BufferSize: Cardinal read write

ClearReferences  protected

Clears list of datasets and deltas. Called when destroying the streamer.

procedure ClearReferences

Data  protected

Stream that contains data (datasets and deltas)

property Data: TStream read write

Dataset_GetPK  protected

Returns string that contains names of primary key fields. Forms ADest array with primary key fields from ASource array with all dataset fields

function Dataset_GetPK(const ASource: TDAFieldArray; var ADest: TDAFieldArray): string

Parameters:

  • ASource: array with all dataset fields
  • ADest: array with primary key fields

DatasetCount

Count of datasets in the streamer

property DatasetCount: integer read write

DatasetInfoObjects  protected

Stores information about Dataset element in the streamer, specified by the index. For TDADataStreamer descedents TDABin2DataStreamer and TDABinDataStreamer this property includes type of the element (dataset or delta), name of the element and offset of the element in the stream. For TDAJSONDataStreamer and TDAXmlDataStreamer it has nil value.

property DatasetInfoObjects[Index: integer]: TObject read write

DatasetNames

Returns Dataset name by the index

property DatasetNames[Index: integer]: string read write

DeltaCount

Count of deltas in the streamer

property DeltaCount: integer read write

DeltaInfoObjects  protected

Stores information about Delta element in the streamer, specified by the index. For TDADataStreamer descedents TDABin2DataStreamer and TDABinDataStreamer this property includes type of the element (dataset or delta), name of the element and offset of the element in the stream. For TDAJSONDataStreamer and TDAXmlDataStreamer it has nil value.

property DeltaInfoObjects[Index: integer]: TObject read write

DeltaNames

Returns Delta name by the index

property DeltaNames[Index: integer]: string read write

DoBeginWriteDataset  protected virtual abstract

Begins to write either Schema or Source dataset in the streamer ( DoWriteDataset method pass Source dataset): writes dataset schema in the streamer and prepares TDADataForAppend structure

function DoBeginWriteDataset(const Source: IDADataset; const Schema: TDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): TDADataForAppend

Parameters:

  • Source: dataset that should be written in the data streamer
  • Schema: dataset that should be written in the data streamer. If it is nil then Source dataset will be written
  • Options: specifies what should be written in the streamer: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of fields that should be written

DoCreateStream  protected virtual abstract

This method is deprecated and used for backward capability. Returns nil result.

function DoCreateStream: TStream

DoEndWriteDataset  protected virtual abstract

Finalizes writing dataset: gets necessary information from aDataForAppend structure, prepared by DoBeginWriteDataset and DoWriteDatasetData methods. Returns count of dataset records.

function DoEndWriteDataset(aDataForAppend: TDADataForAppend): Integer

Parameters:

  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the streamer. It is formed by DoBeginWriteDataset and DoWriteDatasetData methods

DoFinalize  protected virtual abstract

Finalizes the streamer

procedure DoFinalize

DoInitialize  protected virtual abstract

Initializes streamer for using in appropriate Mode.

procedure DoInitialize(Mode: TDAAdapterInitialization)

Parameters:

  • Mode: specifies what for the streamer is initialized - reading or writing

DoReadDataset  protected virtual

Reads dataset with the name DatasetName in the Destination dataset

procedure DoReadDataset(const DatasetName: string; const Destination: IDADataset; ApplySchema: boolean; AppendMode: Boolean)

Parameters:

  • DatasetName: name of the dataset
  • Destination: dataset into which dataset from the streamer will be read
  • ApplySchema: specifies if schema should be applied to the dataset
  • AppendMode: indicates if data should be appended to the Destination dataset

DoReadDelta  protected virtual abstract

Reads delta with the name DeltaName in the Destination delta.

procedure DoReadDelta(const DeltaName: string; const Destination: IDADelta)

Parameters:

  • DeltaName: name of the delta in the streamer
  • Destination: delta into which delta from the streamer will be read

DoWriteDataset (IDADataset, TDAWriteOptions, integer): integer  protected overload

Writes Source dataset in the streamer. Returns count of the dataset records.

function DoWriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written

DoWriteDataset (IDADataset, TDAWriteOptions, integer, array of string): integer  protected overload virtual abstract

Writes Source dataset in the streamer. Returns count of the dataset records.

function DoWriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of the dataset fields that should be written

DoWriteDatasetData  protected virtual abstract

Writes data of the Source dataset in the streamer. Use aDataForAppend structure for sequential dataset adding. Returns records count of the streamed dataset.

function DoWriteDatasetData(const Source: IDADataset; var aDataForAppend: TDADataForAppend; aUnionSourceIndex: Integer): Integer

Parameters:

  • Source: dataset that should be written into the streamer
  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the streamer. It is formed by DoBeginWriteDataset method
  • aUnionSourceIndex: specifies source table for the union table row. Used in old style unions' processing

DoWriteDelta  protected virtual abstract

Writes Source delta into the streamer

procedure DoWriteDelta(const Source: IDADelta)

Parameters:

  • Source: delta that should be written in the streamer

EndWriteDataset

Finalizes writing dataset: gets necessary information from aDataForAppend structure, prepared by DoBeginWriteDataset and DoWriteDatasetData methods. Returns count of dataset records.

function EndWriteDataset(aDataForAppend: TDADataForAppend): Integer

Parameters:

  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the streamer. It is formed by DoBeginWriteDataset and DoWriteDatasetData methods.

Finalize

Finalizes writing dataset: gets necessary information from aDataForAppend structure, prepared by DoBeginWriteDataset and DoWriteDatasetData methods. Returns count of dataset records.

procedure Finalize

FindDatasetIndex

Finds index of the dataset by it's aName

function FindDatasetIndex(const aName: string): integer

Parameters:

  • aName: name of dataset

FindDeltaIndex

Finds index of the delta by it's aName

function FindDeltaIndex(const aName: string): integer

Parameters:

  • aName: name of delta

GetDatasetIndex

Returns dataset index by it's aName. Raises exception if there is no such dataset in the stream.

function GetDatasetIndex(const aName: string): integer

Parameters:

  • aName: name of dataset

GetDeltaIndex

Returns delta index by it's aName. Raises exception if there is no such delta in the stream.

function GetDeltaIndex(const aName: string): integer

Parameters:

  • aName: name of delta

GetTargetDataType  virtual abstract

Returns the type of the data in the streamer.

function GetTargetDataType: TRODataType

HasReducedDelta  virtual

Checks if the streamer sends reduced Deltas

function HasReducedDelta: Boolean

Initialize

Initializes the streamer for data transmission in appropriate Mode and set necessary properties for streamer's stream

procedure Initialize(Stream: TStream; Mode: TDAAdapterInitialization)

Parameters:

  • Stream: stream that is used for data transfer
  • Mode: specifies what for the streamer is initialized - reading or writing

OnBeforeFieldValueSerialization

Fires before the field value serialization giving the opportunity to change this value.

property OnBeforeFieldValueSerialization: TDAReadWriteFieldValue read write
delegate: procedure OnBeforeFieldValueSerialization(const aField: TDAField; var Value: Variant)

OnFinalized

Fires whenever the streamer is finalized

property OnFinalized: TNotifyEvent read write

OnInitialized

Fires whenever the streamer is initialized

property OnInitialized: TNotifyEvent read write

OnReadDataset

Fires when the streamer reads dataset from the stream

property OnReadDataset: TDADatasetOperation read write
delegate: procedure OnReadDataset(DataStreamer: TDADataStreamer; const Datasetname: string; const Dataset: IDADataset)

OnReadDatasetProgress

Fires after reading of every row of the dataset.

property OnReadDatasetProgress: TDADataStreamerReadDatasetProgress read write
delegate: procedure OnReadDatasetProgress(Sender: TDADataStreamer; const aDataset: IDADataset; const aCurrent: Integer; const aTotal: Integer)

OnReadDelta

Fires when the streamer reads delta from the stream

property OnReadDelta: TDADeltaOperation read write
delegate: procedure OnReadDelta(DataStreamer: TDADataStreamer; const DeltaName: string; const Delta: IDADelta)

OnReadDeltaProgress

Fires after reading of every change of the delta

property OnReadDeltaProgress: TDADataStreamerDeltaProgress read write
delegate: procedure OnReadDeltaProgress(Sender: TDADataStreamer; const aDelta: IDADelta; const aCurrent: Integer; const aTotal: Integer)

OnReadFieldValue

Fires whenever the streamer reads field value from the stream

property OnReadFieldValue: TDAReadWriteFieldValue read write
delegate: procedure OnReadFieldValue(const aField: TDAField; var Value: Variant)

OnWriteDataset

Fires when the streamer writes dataset in the stream

property OnWriteDataset: TDADatasetOperation read write
delegate: procedure OnWriteDataset(DataStreamer: TDADataStreamer; const Datasetname: string; const Dataset: IDADataset)

OnWriteDatasetProgress

Fires after the streamer has written every row of the dataset in the stream

property OnWriteDatasetProgress: TDADataStreamerWriteDatasetProgress read write
delegate: procedure OnWriteDatasetProgress(Sender: TDADataStreamer; const aDataset: IDADataset; const aCurrent: Integer; const aMaxRecords: Integer)

OnWriteDelta

Fires whenever the streamer writes delta in the stream

property OnWriteDelta: TDADeltaOperation read write
delegate: procedure OnWriteDelta(DataStreamer: TDADataStreamer; const DeltaName: string; const Delta: IDADelta)

OnWriteDeltaProgress

Fires after writing every delta change in the stream

property OnWriteDeltaProgress: TDADataStreamerDeltaProgress read write
delegate: procedure OnWriteDeltaProgress(Sender: TDADataStreamer; const aDelta: IDADelta; const aCurrent: Integer; const aTotal: Integer)

OnWriteFieldValue

Fires whenever the field value is written to the stream given the event handler opportunity to change the value.

property OnWriteFieldValue: TDAReadWriteFieldValue read write
delegate: procedure OnWriteFieldValue(const aField: TDAField; var Value: Variant)

OnWriteFieldValueEx

Fires whenever the field value is written to the stream given the event handler opportunity to change the value. Extends OnWriteFieldValue functionality by providing access to the source dataset.

property OnWriteFieldValueEx: TDAReadWriteFieldValueEx read write
delegate: procedure OnWriteFieldValueEx(const aDataset: IDADataset; const aField: TDAField; var Value: Variant)

ReadDataset (string, IDADataset, boolean, boolean, Boolean)  overload

Reads dataset from the stream in the Destination dataset. The streamer should be initialized before using this method and finalized after it.

procedure ReadDataset(const DatasetName: string; const Destination: IDADataset; ApplySchema: boolean; LoadRecords: boolean; AppendMode: Boolean)

Parameters:

  • DatasetName: name of dataset that is read from the stream
  • Destination: dataset into which dataset is read from the stream
  • ApplySchema: specifies if schema should be applied to the dataset
  • LoadRecords: defines if data should be read from the stream
  • AppendMode: indicates if data should be appended to the Destination dataset.

ReadDataset (TStream, IDADataset, boolean, string, boolean, boolean, Boolean)  overload

Reads dataset from the Stream in the Destinaion dataset. The streamer's initilization and finalization is performed inside this method. If DatasetName is not set it reads first dataset from the Stream.

procedure ReadDataset(Stream: TStream; const Destination: IDADataset; ApplySchema: boolean; DatasetName: string; LoadRecords: boolean; ReadFromBeginning: boolean; AppendMode: Boolean)

Parameters:

  • Stream: stream from where dataset is read
  • Destination: dataset into which dataset is read from the stream
  • ApplySchema: specifies if schema should be applied to the dataset
  • DatasetName: name of dataset that is read from the stream
  • LoadRecords: defines if data should be readed from the stream
  • ReadFromBeginning: specifies if the streamer should be initialized for reading from beginning of the stream
  • AppendMode: indicates if data should be appended to the Destination dataset

ReadDelta (IDADataset)  overload

Reads delta of the Destination dataset from the stream. Raises exception if Destination dataset has no delta.

procedure ReadDelta(const Destination: IDADataset)

Parameters:

  • Destination: dataset - owner of delta, that is read from the stream

ReadDelta (string): IDADelta  overload

Creates new delta with the name DeltaName and reads in it DeltaName delta from the stream. Returns newly created delta

function ReadDelta(const DeltaName: string): IDADelta

Parameters:

  • DeltaName: Name of delta that is read from the stream. Name for result delta also

ReadDelta (string, IDADelta)  overload

Reads delta from the stream.

procedure ReadDelta(const DeltaName: string; const Destination: IDADelta)

Parameters:

  • DeltaName: name of delat that is read from the stream
  • Destination: delta into which delta from the stream is read

ReadDelta (TStream, IDADelta, string, boolean)  overload

Reads delta from the Stream in the Destination delta. Initialization and finalization of the streamer is performed inside this method.

procedure ReadDelta(Stream: TStream; const Destination: IDADelta; DeltaName: string; ReadFromBeginning: boolean)

Parameters:

  • Stream: stream from where delta is read
  • Destination: delta into which delta from the stream is read
  • DeltaName: name of delta that is read from the stream
  • ReadFromBeginning: specifies if the streamer should be initialized for reading from beginning of the stream

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

SendReducedDelta

Defines if the streamer sends Reduced Delta

property SendReducedDelta: boolean read write

SetBufferSize  protected virtual

Sets the BufferSize which will be allocated for operations

procedure SetBufferSize(const Value: cardinal)

Parameters:


TargetDataType

Returns the data type of the data in the stream. * rtBinary for TDABinDataStreamer and TDABin2DataStreamer; * rtString for TDAXmlDataStreamer; * rtXML for TDAJSONDataStreamer;

property TargetDataType: TRODataType read write

WriteDataset (IDADataset, TDAWriteOptions, integer): integer  overload

Writes all fields of Source dataset in the streamer. Returns count of the dataset records.

function WriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written

WriteDataset (IDADataset, TDAWriteOptions, integer, array of string): integer  overload

Writes Source dataset in the streamer. Returns count of the dataset records.

function WriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of the dataset fields that should be written

WriteDataset (TStream, IDADataset, TDAWriteOptions, integer): integer  overload

Writes all fields of Source dataset in the Stream. Initialization and finalization of the streamer is performed inside this method. Returns count of the dataset records.

function WriteDataset(Stream: TStream; const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer): integer

Parameters:

  • Stream: stream in which dataset is written
  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written

WriteDatasetData

Writes Source dataset data in the streamer's stream. Sets new values for fields of aDataForAppend structure.

function WriteDatasetData(const Source: IDADataset; var aDataForAppend: TDADataForAppend; aUnionSourceIndex: Integer): Integer

Parameters:

  • Source: dataset that is written into the streamer
  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the stream. It is formed in DoBeginWriteDataset method.
  • aUnionSourceIndex: used in old style unions' processing for writing union tables' data and specifies source table for the row.

WriteDelta (IDADataset)  overload

Checks if Source dataset owns delta and, if it's so, writes this delta in the stream

procedure WriteDelta(const Source: IDADataset)

Parameters:

  • Source: dataset - owner of delta, that should be written into the streamer

WriteDelta (IDADelta)  overload

Writes Source delta to the stream

procedure WriteDelta(const Source: IDADelta)

Parameters:

  • Source: delta that should be written into the streamer

WriteDelta (TStream, IDADataset)  overload

Writes Source delta to the Stream. Initialization and Finalization of the streamer is performed inside this method

procedure WriteDelta(Stream: TStream; const Source: IDADataset)

Parameters:

  • Stream: stream into which delta is written
  • Source: dataset - owner of delta, that should be written into the streamer

 

AdapterInitialization  protected

Defines what for the streamer is initialized.

property AdapterInitialization: TDAAdapterInitialization read write

BufferSize

Specifies the default buffer size which will be allocated for operations.

property BufferSize: Cardinal read write

Data  protected

Stream that contains data (datasets and deltas)

property Data: TStream read write

DatasetCount

Count of datasets in the streamer

property DatasetCount: integer read write

DatasetInfoObjects  protected

Stores information about Dataset element in the streamer, specified by the index. For TDADataStreamer descedents TDABin2DataStreamer and TDABinDataStreamer this property includes type of the element (dataset or delta), name of the element and offset of the element in the stream. For TDAJSONDataStreamer and TDAXmlDataStreamer it has nil value.

property DatasetInfoObjects[Index: integer]: TObject read write

DatasetNames

Returns Dataset name by the index

property DatasetNames[Index: integer]: string read write

DeltaCount

Count of deltas in the streamer

property DeltaCount: integer read write

DeltaInfoObjects  protected

Stores information about Delta element in the streamer, specified by the index. For TDADataStreamer descedents TDABin2DataStreamer and TDABinDataStreamer this property includes type of the element (dataset or delta), name of the element and offset of the element in the stream. For TDAJSONDataStreamer and TDAXmlDataStreamer it has nil value.

property DeltaInfoObjects[Index: integer]: TObject read write

DeltaNames

Returns Delta name by the index

property DeltaNames[Index: integer]: string read write

SendReducedDelta

Defines if the streamer sends Reduced Delta

property SendReducedDelta: boolean read write

TargetDataType

Returns the data type of the data in the stream. * rtBinary for TDABinDataStreamer and TDABin2DataStreamer; * rtString for TDAXmlDataStreamer; * rtXML for TDAJSONDataStreamer;

property TargetDataType: TRODataType read write

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

AddingDataset  protected

This method is used internally when dataset is written in the stream. Adds name of aDatasetName dataset and DatasetInfoObjects for it in the list of datasets that are written in the stream.

procedure AddingDataset(const aDatasetName: string; InfoObject: TObject)

Parameters:

  • aDatasetName: Name of dataset that is written in the stream and added in the list of datasets
  • InfoObject: DatasetInfoObjects that is added in the internally used list of datasets

AddingDelta  protected

This method is used internally when delta is written in the stream. Adds name of aDeltaName delta and DeltaInfoObjects for it in the list of deltas that are written in the stream.

procedure AddingDelta(const aDeltaName: string; InfoObject: TObject)

Parameters:

  • aDeltaName: Name of delta that is written in the stream and added in the list of deltas
  • InfoObject: DeltaInfoObjects that is added in the internally used list of deltas

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

BeginWriteDataset

Calls descedant's implementation of DoBeginWriteDataset

function BeginWriteDataset(const Source: IDADataset; const Schema: TDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): TDADataForAppend

Parameters:

  • Source: dataset that should be written in the data streamer
  • Schema: dataset that should be written in the data streamer. If it is nil then Source datase will be written
  • Options: specifies what should be written in the streamer: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of fields that should be written

ClearReferences  protected

Clears list of datasets and deltas. Called when destroying the streamer.

procedure ClearReferences

Dataset_GetPK  protected

Returns string that contains names of primary key fields. Forms ADest array with primary key fields from ASource array with all dataset fields

function Dataset_GetPK(const ASource: TDAFieldArray; var ADest: TDAFieldArray): string

Parameters:

  • ASource: array with all dataset fields
  • ADest: array with primary key fields

DoBeginWriteDataset  protected virtual abstract

Begins to write either Schema or Source dataset in the streamer ( DoWriteDataset method pass Source dataset): writes dataset schema in the streamer and prepares TDADataForAppend structure

function DoBeginWriteDataset(const Source: IDADataset; const Schema: TDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): TDADataForAppend

Parameters:

  • Source: dataset that should be written in the data streamer
  • Schema: dataset that should be written in the data streamer. If it is nil then Source dataset will be written
  • Options: specifies what should be written in the streamer: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of fields that should be written

DoCreateStream  protected virtual abstract

This method is deprecated and used for backward capability. Returns nil result.

function DoCreateStream: TStream

DoEndWriteDataset  protected virtual abstract

Finalizes writing dataset: gets necessary information from aDataForAppend structure, prepared by DoBeginWriteDataset and DoWriteDatasetData methods. Returns count of dataset records.

function DoEndWriteDataset(aDataForAppend: TDADataForAppend): Integer

Parameters:

  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the streamer. It is formed by DoBeginWriteDataset and DoWriteDatasetData methods

DoFinalize  protected virtual abstract

Finalizes the streamer

procedure DoFinalize

DoInitialize  protected virtual abstract

Initializes streamer for using in appropriate Mode.

procedure DoInitialize(Mode: TDAAdapterInitialization)

Parameters:

  • Mode: specifies what for the streamer is initialized - reading or writing

DoReadDataset  protected virtual

Reads dataset with the name DatasetName in the Destination dataset

procedure DoReadDataset(const DatasetName: string; const Destination: IDADataset; ApplySchema: boolean; AppendMode: Boolean)

Parameters:

  • DatasetName: name of the dataset
  • Destination: dataset into which dataset from the streamer will be read
  • ApplySchema: specifies if schema should be applied to the dataset
  • AppendMode: indicates if data should be appended to the Destination dataset

DoReadDelta  protected virtual abstract

Reads delta with the name DeltaName in the Destination delta.

procedure DoReadDelta(const DeltaName: string; const Destination: IDADelta)

Parameters:

  • DeltaName: name of the delta in the streamer
  • Destination: delta into which delta from the streamer will be read

DoWriteDataset (IDADataset, TDAWriteOptions, integer): integer  protected overload

Writes Source dataset in the streamer. Returns count of the dataset records.

function DoWriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written

DoWriteDataset (IDADataset, TDAWriteOptions, integer, array of string): integer  protected overload virtual abstract

Writes Source dataset in the streamer. Returns count of the dataset records.

function DoWriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of the dataset fields that should be written

DoWriteDatasetData  protected virtual abstract

Writes data of the Source dataset in the streamer. Use aDataForAppend structure for sequential dataset adding. Returns records count of the streamed dataset.

function DoWriteDatasetData(const Source: IDADataset; var aDataForAppend: TDADataForAppend; aUnionSourceIndex: Integer): Integer

Parameters:

  • Source: dataset that should be written into the streamer
  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the streamer. It is formed by DoBeginWriteDataset method
  • aUnionSourceIndex: specifies source table for the union table row. Used in old style unions' processing

DoWriteDelta  protected virtual abstract

Writes Source delta into the streamer

procedure DoWriteDelta(const Source: IDADelta)

Parameters:

  • Source: delta that should be written in the streamer

EndWriteDataset

Finalizes writing dataset: gets necessary information from aDataForAppend structure, prepared by DoBeginWriteDataset and DoWriteDatasetData methods. Returns count of dataset records.

function EndWriteDataset(aDataForAppend: TDADataForAppend): Integer

Parameters:

  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the streamer. It is formed by DoBeginWriteDataset and DoWriteDatasetData methods.

Finalize

Finalizes writing dataset: gets necessary information from aDataForAppend structure, prepared by DoBeginWriteDataset and DoWriteDatasetData methods. Returns count of dataset records.

procedure Finalize

FindDatasetIndex

Finds index of the dataset by it's aName

function FindDatasetIndex(const aName: string): integer

Parameters:

  • aName: name of dataset

FindDeltaIndex

Finds index of the delta by it's aName

function FindDeltaIndex(const aName: string): integer

Parameters:

  • aName: name of delta

GetDatasetIndex

Returns dataset index by it's aName. Raises exception if there is no such dataset in the stream.

function GetDatasetIndex(const aName: string): integer

Parameters:

  • aName: name of dataset

GetDeltaIndex

Returns delta index by it's aName. Raises exception if there is no such delta in the stream.

function GetDeltaIndex(const aName: string): integer

Parameters:

  • aName: name of delta

GetTargetDataType  virtual abstract

Returns the type of the data in the streamer.

function GetTargetDataType: TRODataType

HasReducedDelta  virtual

Checks if the streamer sends reduced Deltas

function HasReducedDelta: Boolean

Initialize

Initializes the streamer for data transmission in appropriate Mode and set necessary properties for streamer's stream

procedure Initialize(Stream: TStream; Mode: TDAAdapterInitialization)

Parameters:

  • Stream: stream that is used for data transfer
  • Mode: specifies what for the streamer is initialized - reading or writing

ReadDataset (string, IDADataset, boolean, boolean, Boolean)  overload

Reads dataset from the stream in the Destination dataset. The streamer should be initialized before using this method and finalized after it.

procedure ReadDataset(const DatasetName: string; const Destination: IDADataset; ApplySchema: boolean; LoadRecords: boolean; AppendMode: Boolean)

Parameters:

  • DatasetName: name of dataset that is read from the stream
  • Destination: dataset into which dataset is read from the stream
  • ApplySchema: specifies if schema should be applied to the dataset
  • LoadRecords: defines if data should be read from the stream
  • AppendMode: indicates if data should be appended to the Destination dataset.

ReadDataset (TStream, IDADataset, boolean, string, boolean, boolean, Boolean)  overload

Reads dataset from the Stream in the Destinaion dataset. The streamer's initilization and finalization is performed inside this method. If DatasetName is not set it reads first dataset from the Stream.

procedure ReadDataset(Stream: TStream; const Destination: IDADataset; ApplySchema: boolean; DatasetName: string; LoadRecords: boolean; ReadFromBeginning: boolean; AppendMode: Boolean)

Parameters:

  • Stream: stream from where dataset is read
  • Destination: dataset into which dataset is read from the stream
  • ApplySchema: specifies if schema should be applied to the dataset
  • DatasetName: name of dataset that is read from the stream
  • LoadRecords: defines if data should be readed from the stream
  • ReadFromBeginning: specifies if the streamer should be initialized for reading from beginning of the stream
  • AppendMode: indicates if data should be appended to the Destination dataset

ReadDelta (IDADataset)  overload

Reads delta of the Destination dataset from the stream. Raises exception if Destination dataset has no delta.

procedure ReadDelta(const Destination: IDADataset)

Parameters:

  • Destination: dataset - owner of delta, that is read from the stream

ReadDelta (string): IDADelta  overload

Creates new delta with the name DeltaName and reads in it DeltaName delta from the stream. Returns newly created delta

function ReadDelta(const DeltaName: string): IDADelta

Parameters:

  • DeltaName: Name of delta that is read from the stream. Name for result delta also

ReadDelta (string, IDADelta)  overload

Reads delta from the stream.

procedure ReadDelta(const DeltaName: string; const Destination: IDADelta)

Parameters:

  • DeltaName: name of delat that is read from the stream
  • Destination: delta into which delta from the stream is read

ReadDelta (TStream, IDADelta, string, boolean)  overload

Reads delta from the Stream in the Destination delta. Initialization and finalization of the streamer is performed inside this method.

procedure ReadDelta(Stream: TStream; const Destination: IDADelta; DeltaName: string; ReadFromBeginning: boolean)

Parameters:

  • Stream: stream from where delta is read
  • Destination: delta into which delta from the stream is read
  • DeltaName: name of delta that is read from the stream
  • ReadFromBeginning: specifies if the streamer should be initialized for reading from beginning of the stream

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

SetBufferSize  protected virtual

Sets the BufferSize which will be allocated for operations

procedure SetBufferSize(const Value: cardinal)

Parameters:


WriteDataset (IDADataset, TDAWriteOptions, integer): integer  overload

Writes all fields of Source dataset in the streamer. Returns count of the dataset records.

function WriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written

WriteDataset (IDADataset, TDAWriteOptions, integer, array of string): integer  overload

Writes Source dataset in the streamer. Returns count of the dataset records.

function WriteDataset(const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer; ADynFieldNames: array of string): integer

Parameters:

  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written
  • ADynFieldNames: names of the dataset fields that should be written

WriteDataset (TStream, IDADataset, TDAWriteOptions, integer): integer  overload

Writes all fields of Source dataset in the Stream. Initialization and finalization of the streamer is performed inside this method. Returns count of the dataset records.

function WriteDataset(Stream: TStream; const Source: IDADataset; Options: TDAWriteOptions; MaxRows: integer): integer

Parameters:

  • Stream: stream in which dataset is written
  • Source: dataset that should be written into the streamer
  • Options: specifies what should be written: rows, schema or both
  • MaxRows: number of rows that should be written

WriteDatasetData

Writes Source dataset data in the streamer's stream. Sets new values for fields of aDataForAppend structure.

function WriteDatasetData(const Source: IDADataset; var aDataForAppend: TDADataForAppend; aUnionSourceIndex: Integer): Integer

Parameters:

  • Source: dataset that is written into the streamer
  • aDataForAppend: structure that stores information necessary for sequential appending and reading datasets or deltas in the stream. It is formed in DoBeginWriteDataset method.
  • aUnionSourceIndex: used in old style unions' processing for writing union tables' data and specifies source table for the row.

WriteDelta (IDADataset)  overload

Checks if Source dataset owns delta and, if it's so, writes this delta in the stream

procedure WriteDelta(const Source: IDADataset)

Parameters:

  • Source: dataset - owner of delta, that should be written into the streamer

WriteDelta (IDADelta)  overload

Writes Source delta to the stream

procedure WriteDelta(const Source: IDADelta)

Parameters:

  • Source: delta that should be written into the streamer

WriteDelta (TStream, IDADataset)  overload

Writes Source delta to the Stream. Initialization and Finalization of the streamer is performed inside this method

procedure WriteDelta(Stream: TStream; const Source: IDADataset)

Parameters:

  • Stream: stream into which delta is written
  • Source: dataset - owner of delta, that should be written into the streamer

 

OnBeforeFieldValueSerialization

Fires before the field value serialization giving the opportunity to change this value.

property OnBeforeFieldValueSerialization: TDAReadWriteFieldValue read write
delegate: procedure OnBeforeFieldValueSerialization(const aField: TDAField; var Value: Variant)

OnFinalized

Fires whenever the streamer is finalized

property OnFinalized: TNotifyEvent read write

OnInitialized

Fires whenever the streamer is initialized

property OnInitialized: TNotifyEvent read write

OnReadDataset

Fires when the streamer reads dataset from the stream

property OnReadDataset: TDADatasetOperation read write
delegate: procedure OnReadDataset(DataStreamer: TDADataStreamer; const Datasetname: string; const Dataset: IDADataset)

OnReadDatasetProgress

Fires after reading of every row of the dataset.

property OnReadDatasetProgress: TDADataStreamerReadDatasetProgress read write
delegate: procedure OnReadDatasetProgress(Sender: TDADataStreamer; const aDataset: IDADataset; const aCurrent: Integer; const aTotal: Integer)

OnReadDelta

Fires when the streamer reads delta from the stream

property OnReadDelta: TDADeltaOperation read write
delegate: procedure OnReadDelta(DataStreamer: TDADataStreamer; const DeltaName: string; const Delta: IDADelta)

OnReadDeltaProgress

Fires after reading of every change of the delta

property OnReadDeltaProgress: TDADataStreamerDeltaProgress read write
delegate: procedure OnReadDeltaProgress(Sender: TDADataStreamer; const aDelta: IDADelta; const aCurrent: Integer; const aTotal: Integer)

OnReadFieldValue

Fires whenever the streamer reads field value from the stream

property OnReadFieldValue: TDAReadWriteFieldValue read write
delegate: procedure OnReadFieldValue(const aField: TDAField; var Value: Variant)

OnWriteDataset

Fires when the streamer writes dataset in the stream

property OnWriteDataset: TDADatasetOperation read write
delegate: procedure OnWriteDataset(DataStreamer: TDADataStreamer; const Datasetname: string; const Dataset: IDADataset)

OnWriteDatasetProgress

Fires after the streamer has written every row of the dataset in the stream

property OnWriteDatasetProgress: TDADataStreamerWriteDatasetProgress read write
delegate: procedure OnWriteDatasetProgress(Sender: TDADataStreamer; const aDataset: IDADataset; const aCurrent: Integer; const aMaxRecords: Integer)

OnWriteDelta

Fires whenever the streamer writes delta in the stream

property OnWriteDelta: TDADeltaOperation read write
delegate: procedure OnWriteDelta(DataStreamer: TDADataStreamer; const DeltaName: string; const Delta: IDADelta)

OnWriteDeltaProgress

Fires after writing every delta change in the stream

property OnWriteDeltaProgress: TDADataStreamerDeltaProgress read write
delegate: procedure OnWriteDeltaProgress(Sender: TDADataStreamer; const aDelta: IDADelta; const aCurrent: Integer; const aTotal: Integer)

OnWriteFieldValue

Fires whenever the field value is written to the stream given the event handler opportunity to change the value.

property OnWriteFieldValue: TDAReadWriteFieldValue read write
delegate: procedure OnWriteFieldValue(const aField: TDAField; var Value: Variant)

OnWriteFieldValueEx

Fires whenever the field value is written to the stream given the event handler opportunity to change the value. Extends OnWriteFieldValue functionality by providing access to the source dataset.

property OnWriteFieldValueEx: TDAReadWriteFieldValueEx read write
delegate: procedure OnWriteFieldValueEx(const aDataset: IDADataset; const aField: TDAField; var Value: Variant)

Descendants

See Also