DABin2DataStreamer
Overview
Concrete implementation of a DADataStreamer, providing the standard Data Abstract Bin2DataStreamer protocol implementation.
Location
- Reference: DABin2DataStreamer.h
- Namespace: DataAbstract
- Ancestry: NSObject | DADataStreamer | DABin2DataStreamer
data (declared in DADataStreamer)
Represents the bytes buffer that holds serialized data. Returns nil for this abstract class.
@property (readonly) NSData *data
dataStreamerWithData:
Class method that creates and initialized DABin2DataStreamer instance with given NSData instance
+ (id) dataStreamerWithData:(NSData *)data
Parameters:
- data:
doFinalizeStreamer (declared in DADataStreamer)
- (void) doFinalizeStreamer
doFinalizeStreamerWithMode:
- (void) doFinalizeStreamerWithMode:(enum DAStreamerMode)aMode
Parameters:
- aMode:
doInitializeStreamerWithMode:andData:andOffset: doInitializeStreamerWithMode:(enum DAStreamerMode) andData:(NSData *) andOffset:(int)
- (void) doInitializeStreamerWithMode:(enum DAStreamerMode)aMode andData:(NSData *)aData andOffset:(int)anOffset
Parameters:
- aMode:
- aData:
- anOffset:
doInitializeStreamerWithMode:andData:andOffset: doInitializeStreamerWithMode:(enum DAStreamerMode) andData:(NSData *) andOffset:(int) (declared in DADataStreamer)
- (void) doInitializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset
Parameters:
- mode:
- data:
- anOffset:
doReadDataTable:toTable: doReadDataTable:(NSString *) toTable:(DADataTable *)
- (void) doReadDataTable:(NSString *)aTableName toTable:(DADataTable *)aTable
Parameters:
- aTableName:
- aTable:
doReadDataTable:toTable: doReadDataTable:(NSString *) toTable:(DADataTable *) (declared in DADataStreamer)
- (void) doReadDataTable:(NSString *)tableName toTable:(DADataTable *)table
Parameters:
- tableName:
- table:
doReadDelta:forTable: doReadDelta:(DADelta *) forTable:(DADataTable *)
- (void) doReadDelta:(DADelta *)aDelta forTable:(DADataTable *)aTable
Parameters:
- aDelta:
- aTable:
doReadDelta:forTable: doReadDelta:(DADelta *) forTable:(DADataTable *) (declared in DADataStreamer)
- (void) doReadDelta:(DADelta *)aDelta forTable:(DADataTable *)table
Parameters:
- aDelta:
- table:
doWriteChangesForTable: doWriteChangesForTable:(DADataTable *)
- (void) doWriteChangesForTable:(DADataTable *)aTable
Parameters:
- aTable:
doWriteChangesForTable: doWriteChangesForTable:(DADataTable *) (declared in DADataStreamer)
- (void) doWriteChangesForTable:(DADataTable *)table
Parameters:
- table:
doWriteDataTable: doWriteDataTable:(DADataTable *)
- (void) doWriteDataTable:(DADataTable *)aTable
Parameters:
- aTable:
doWriteDataTable: doWriteDataTable:(DADataTable *) (declared in DADataStreamer)
- (void) doWriteDataTable:(DADataTable *)table
Parameters:
- table:
doWriteDelta: (declared in DADataStreamer)
- (void) doWriteDelta:(DADelta *)aDelta
Parameters:
- aDelta:
finalizeStreamer (declared in DADataStreamer)
Finalizes an opened streamer. After finalization, the streamer mode is always set to None
.
- (void) finalizeStreamer
getDataTable:
For internal use only. Deserializes and returns an instance of a DADataTable with the given table name from the internal data buffer.
- (DADataTable *) getDataTable:(NSString *)tableName
Parameters:
- tableName:
initializeStreamerWithMode:andData: (declared in DADataStreamer)
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: (declared in DADataStreamer)
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.
initWithData:
- (InstanceType) initWithData:(NSData *)data
Parameters:
- data:
initWithData:offset:
- (InstanceType) initWithData:(NSData *)data offset:(int)offset
Parameters:
- data:
- offset:
load
- (void) load
readDataTable:
- (void) readDataTable:(DADataTable *)table
Parameters:
- table:
readDataTable:toTable: (declared in DADataStreamer)
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: (declared in DADataStreamer)
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.
readRealSchemaForTable:
- (void) readRealSchemaForTable:(DADataTable *)aTable
Parameters:
- aTable:
readSchemaForTable:
- (void) readSchemaForTable:(DADataTable *)aTable
Parameters:
- aTable:
readValueOfType:fromReader:
+ (id) readValueOfType:(enum DADataType)aType fromReader:(ROBinReaderWriter *)aReader
Parameters:
- aType:
- aReader:
sourceData
For internal use only. Provides a reference to the ROBinReaderWriter instance used to serialize/deserialize data to and from the internal binary format.
@property (readonly) ROBinReaderWriter *sourceData
streamerMode (declared in DADataStreamer)
Returns one of the following streamer modes: Reading
, Reading from beginning
, Writing
or None
.
@property (readonly) enum DAStreamerMode streamerMode
tableNames (declared in DADataStreamer)
Returns an array of all names of the tables serialized in the current bytes buffer.
@property (readonly) NSArray *tableNames
writeChangesForTable: (declared in DADataStreamer)
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: (declared in DADataStreamer)
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.
writeDataTables:
For internal use only. Serializes the passed array of DADataTables into binary format and returns the result as a NSData
buffer of raw data.
+ (NSData *) writeDataTables:(NSArray *)tables
Parameters:
- tables:
writeDelta: (declared in DADataStreamer)
method serializes given DADelta to the DADeltaStreamer
- (void) writeDelta:(DADelta *)aDelta
Parameters:
- aDelta: DADelta instance we want to serialize to the DADeltaStreamer
writeRealSchemaForTable:toWriter:
+ (void) writeRealSchemaForTable:(DADataTable *)aTable toWriter:(ROBinReaderWriter *)aWriter
Parameters:
- aTable:
- aWriter:
writeSchemaForTable:toWriter:
+ (void) writeSchemaForTable:(DADataTable *)aTable toWriter:(ROBinReaderWriter *)aWriter
Parameters:
- aTable:
- aWriter:
writeTable:ToData:
For internal use only. Serializes a single DADataTable into the provided buffer.
+ (void) writeTable:(DADataTable *)table ToData:(NSMutableData *)data
Parameters:
- table:
- data:
writeValue:ofType:toWriter:
+ (void) writeValue:(id)aValue ofType:(enum DADataType)aType toWriter:(ROBinReaderWriter *)aWriter
Parameters:
- aValue:
- aType:
- aWriter:
data (declared in DADataStreamer)
Represents the bytes buffer that holds serialized data. Returns nil for this abstract class.
@property (readonly) NSData *data
sourceData
For internal use only. Provides a reference to the ROBinReaderWriter instance used to serialize/deserialize data to and from the internal binary format.
@property (readonly) ROBinReaderWriter *sourceData
streamerMode (declared in DADataStreamer)
Returns one of the following streamer modes: Reading
, Reading from beginning
, Writing
or None
.
@property (readonly) enum DAStreamerMode streamerMode
tableNames (declared in DADataStreamer)
Returns an array of all names of the tables serialized in the current bytes buffer.
@property (readonly) NSArray *tableNames
dataStreamerWithData:
Class method that creates and initialized DABin2DataStreamer instance with given NSData instance
+ (id) dataStreamerWithData:(NSData *)data
Parameters:
- data:
readValueOfType:fromReader:
+ (id) readValueOfType:(enum DADataType)aType fromReader:(ROBinReaderWriter *)aReader
Parameters:
- aType:
- aReader:
writeDataTables:
For internal use only. Serializes the passed array of DADataTables into binary format and returns the result as a NSData
buffer of raw data.
+ (NSData *) writeDataTables:(NSArray *)tables
Parameters:
- tables:
writeRealSchemaForTable:toWriter:
+ (void) writeRealSchemaForTable:(DADataTable *)aTable toWriter:(ROBinReaderWriter *)aWriter
Parameters:
- aTable:
- aWriter:
writeSchemaForTable:toWriter:
+ (void) writeSchemaForTable:(DADataTable *)aTable toWriter:(ROBinReaderWriter *)aWriter
Parameters:
- aTable:
- aWriter:
writeTable:ToData:
For internal use only. Serializes a single DADataTable into the provided buffer.
+ (void) writeTable:(DADataTable *)table ToData:(NSMutableData *)data
Parameters:
- table:
- data:
writeValue:ofType:toWriter:
+ (void) writeValue:(id)aValue ofType:(enum DADataType)aType toWriter:(ROBinReaderWriter *)aWriter
Parameters:
- aValue:
- aType:
- aWriter:
doFinalizeStreamer (declared in DADataStreamer)
- (void) doFinalizeStreamer
doFinalizeStreamerWithMode:
- (void) doFinalizeStreamerWithMode:(enum DAStreamerMode)aMode
Parameters:
- aMode:
doInitializeStreamerWithMode:andData:andOffset: doInitializeStreamerWithMode:(enum DAStreamerMode) andData:(NSData *) andOffset:(int)
- (void) doInitializeStreamerWithMode:(enum DAStreamerMode)aMode andData:(NSData *)aData andOffset:(int)anOffset
Parameters:
- aMode:
- aData:
- anOffset:
doInitializeStreamerWithMode:andData:andOffset: doInitializeStreamerWithMode:(enum DAStreamerMode) andData:(NSData *) andOffset:(int) (declared in DADataStreamer)
- (void) doInitializeStreamerWithMode:(enum DAStreamerMode)mode andData:(NSData *)data andOffset:(int)anOffset
Parameters:
- mode:
- data:
- anOffset:
doReadDataTable:toTable: doReadDataTable:(NSString *) toTable:(DADataTable *)
- (void) doReadDataTable:(NSString *)aTableName toTable:(DADataTable *)aTable
Parameters:
- aTableName:
- aTable:
doReadDataTable:toTable: doReadDataTable:(NSString *) toTable:(DADataTable *) (declared in DADataStreamer)
- (void) doReadDataTable:(NSString *)tableName toTable:(DADataTable *)table
Parameters:
- tableName:
- table:
doReadDelta:forTable: doReadDelta:(DADelta *) forTable:(DADataTable *)
- (void) doReadDelta:(DADelta *)aDelta forTable:(DADataTable *)aTable
Parameters:
- aDelta:
- aTable:
doReadDelta:forTable: doReadDelta:(DADelta *) forTable:(DADataTable *) (declared in DADataStreamer)
- (void) doReadDelta:(DADelta *)aDelta forTable:(DADataTable *)table
Parameters:
- aDelta:
- table:
doWriteChangesForTable: doWriteChangesForTable:(DADataTable *)
- (void) doWriteChangesForTable:(DADataTable *)aTable
Parameters:
- aTable:
doWriteChangesForTable: doWriteChangesForTable:(DADataTable *) (declared in DADataStreamer)
- (void) doWriteChangesForTable:(DADataTable *)table
Parameters:
- table:
doWriteDataTable: doWriteDataTable:(DADataTable *)
- (void) doWriteDataTable:(DADataTable *)aTable
Parameters:
- aTable:
doWriteDataTable: doWriteDataTable:(DADataTable *) (declared in DADataStreamer)
- (void) doWriteDataTable:(DADataTable *)table
Parameters:
- table:
doWriteDelta: (declared in DADataStreamer)
- (void) doWriteDelta:(DADelta *)aDelta
Parameters:
- aDelta:
finalizeStreamer (declared in DADataStreamer)
Finalizes an opened streamer. After finalization, the streamer mode is always set to None
.
- (void) finalizeStreamer
getDataTable:
For internal use only. Deserializes and returns an instance of a DADataTable with the given table name from the internal data buffer.
- (DADataTable *) getDataTable:(NSString *)tableName
Parameters:
- tableName:
initializeStreamerWithMode:andData: (declared in DADataStreamer)
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: (declared in DADataStreamer)
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.
initWithData:
- (InstanceType) initWithData:(NSData *)data
Parameters:
- data:
initWithData:offset:
- (InstanceType) initWithData:(NSData *)data offset:(int)offset
Parameters:
- data:
- offset:
load
- (void) load
readDataTable:
- (void) readDataTable:(DADataTable *)table
Parameters:
- table:
readDataTable:toTable: (declared in DADataStreamer)
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: (declared in DADataStreamer)
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.
readRealSchemaForTable:
- (void) readRealSchemaForTable:(DADataTable *)aTable
Parameters:
- aTable:
readSchemaForTable:
- (void) readSchemaForTable:(DADataTable *)aTable
Parameters:
- aTable:
writeChangesForTable: (declared in DADataStreamer)
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: (declared in DADataStreamer)
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: (declared in DADataStreamer)
method serializes given DADelta to the DADeltaStreamer
- (void) writeDelta:(DADelta *)aDelta
Parameters:
- aDelta: DADelta instance we want to serialize to the DADeltaStreamer