DADataStreamer

Overview

DADataStreamer is an abstract base class for all Data Streamers. This class shouldn't be used directly; instead, you should use concrete streamer implementations like DABin2DataStreamer.

Tasks

Initialize and Finalize streamer

  • initializeStreamerWithMode:andData:andOffset:
  • initializeStreamerWithMode:andData:
  • finalizeStreamer;

Read/Write table

  • readDataTable:toTable:
  • writeDataTable:

Read/Write changes

  • readDelta:forTable:
  • writeChangesForTable:

Location


 

data

Represents the bytes buffer that holds serialized data. Returns nil for this abstract class.

@property (readonly) NSData *data

doFinalizeStreamer

- (void) doFinalizeStreamer

doInitializeStreamerWithMode:andData:andOffset:

- (void) doInitializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset

Parameters:

  • mode:
  • data:
  • anOffset:

doReadDataTable:toTable:

- (void) doReadDataTable:(NSString *)tableName toTable:(DADataTable *)table

Parameters:

  • tableName:
  • table:

doReadDelta:forTable:

- (void) doReadDelta:(DADelta *)aDelta forTable:(DADataTable *)table

Parameters:

  • aDelta:
  • table:

doWriteChangesForTable:

- (void) doWriteChangesForTable:(DADataTable *)table

Parameters:

  • table:

doWriteDataTable:

- (void) doWriteDataTable:(DADataTable *)table

Parameters:

  • table:

doWriteDelta:

- (void) doWriteDelta:(DADelta *)aDelta

Parameters:

  • aDelta:

finalizeStreamer

Finalizes an opened streamer. After finalization, the streamer mode is always set to None.

- (void) finalizeStreamer

initializeStreamerWithMode:andData:

Returns an instance of DADataStreamer initialized with the given mode and the given data buffer.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.

initializeStreamerWithMode:andData:andOffset:

Initializes a streamer instance with the given mode, data buffer and offset.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.
  • anOffset: Start position inside the given bytes buffer.

readDataTable:toTable:

Reads the structure and data of a DADataTable with given name from the data stream into DADataTable.

- (void) readDataTable:(NSString *)tableName toTable:(DADataTable *)table

Parameters:

  • tableName: Name of the table which we want to obtain from the data stream. If stream does not contain table with such name then DA Exception will be raised.
  • table: DADataTable instance to where we read structure and data from the data stream

readDelta:forTable:

Reads the delta object for the given table from the serialized buffer.

- (void) readDelta:(DADelta *)aDelta forTable:(DADataTable *)table

Parameters:

  • aDelta: Instance of the DADelta to read.
  • table: Instance of the DADataTable that holds the delta.

streamerMode

Returns one of the following streamer modes: Reading, Reading from beginning, Writing or None.

@property (readonly) enum DAStreamerMode streamerMode

tableNames

Returns an array of all names of the tables serialized in the current bytes buffer.

@property (readonly) NSArray *tableNames

writeChangesForTable:

Extracts changes for the given table and serializes them to the streamer bytes buffer.

- (void) writeChangesForTable:(DADataTable *)table

Parameters:

  • table: Reference to the changes we want to serialize.

writeDataTable:

Serializes table data with the table schema to the streamer bytes buffer.

- (void) writeDataTable:(DADataTable *)table

Parameters:

  • table: Reference to the DADataTable we want to serialize.

writeDelta:

method serializes given DADelta to the DADeltaStreamer

- (void) writeDelta:(DADelta *)aDelta

Parameters:

  • aDelta: DADelta instance we want to serialize to the DADeltaStreamer

 

data

Represents the bytes buffer that holds serialized data. Returns nil for this abstract class.

@property (readonly) NSData *data

streamerMode

Returns one of the following streamer modes: Reading, Reading from beginning, Writing or None.

@property (readonly) enum DAStreamerMode streamerMode

tableNames

Returns an array of all names of the tables serialized in the current bytes buffer.

@property (readonly) NSArray *tableNames

 

doFinalizeStreamer

- (void) doFinalizeStreamer

doInitializeStreamerWithMode:andData:andOffset:

- (void) doInitializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset

Parameters:

  • mode:
  • data:
  • anOffset:

doReadDataTable:toTable:

- (void) doReadDataTable:(NSString *)tableName toTable:(DADataTable *)table

Parameters:

  • tableName:
  • table:

doReadDelta:forTable:

- (void) doReadDelta:(DADelta *)aDelta forTable:(DADataTable *)table

Parameters:

  • aDelta:
  • table:

doWriteChangesForTable:

- (void) doWriteChangesForTable:(DADataTable *)table

Parameters:

  • table:

doWriteDataTable:

- (void) doWriteDataTable:(DADataTable *)table

Parameters:

  • table:

doWriteDelta:

- (void) doWriteDelta:(DADelta *)aDelta

Parameters:

  • aDelta:

finalizeStreamer

Finalizes an opened streamer. After finalization, the streamer mode is always set to None.

- (void) finalizeStreamer

initializeStreamerWithMode:andData:

Returns an instance of DADataStreamer initialized with the given mode and the given data buffer.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.

initializeStreamerWithMode:andData:andOffset:

Initializes a streamer instance with the given mode, data buffer and offset.

- (void) initializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset

Parameters:

  • mode: Mode of the streamer.
  • data: Bytes buffer with serialized data.
  • anOffset: Start position inside the given bytes buffer.

readDataTable:toTable:

Reads the structure and data of a DADataTable with given name from the data stream into DADataTable.

- (void) readDataTable:(NSString *)tableName toTable:(DADataTable *)table

Parameters:

  • tableName: Name of the table which we want to obtain from the data stream. If stream does not contain table with such name then DA Exception will be raised.
  • table: DADataTable instance to where we read structure and data from the data stream

readDelta:forTable:

Reads the delta object for the given table from the serialized buffer.

- (void) readDelta:(DADelta *)aDelta forTable:(DADataTable *)table

Parameters:

  • aDelta: Instance of the DADelta to read.
  • table: Instance of the DADataTable that holds the delta.

writeChangesForTable:

Extracts changes for the given table and serializes them to the streamer bytes buffer.

- (void) writeChangesForTable:(DADataTable *)table

Parameters:

  • table: Reference to the changes we want to serialize.

writeDataTable:

Serializes table data with the table schema to the streamer bytes buffer.

- (void) writeDataTable:(DADataTable *)table

Parameters:

  • table: Reference to the DADataTable we want to serialize.

writeDelta:

method serializes given DADelta to the DADeltaStreamer

- (void) writeDelta:(DADelta *)aDelta

Parameters:

  • aDelta: DADelta instance we want to serialize to the DADeltaStreamer