ROSerialization

Overview

This is the formal protocol that defines the interface to allow serialization and deserialization of values of all supported types. This protocol is used internally to create message classes such as binary message or SOAP message. You will have to implement this protocol if you want to create your own message class as a ROMessage descendant.
The protocol methods listed below may have common parameters:

  • *withName:(NSString )aName is used to pass the name of the value to process. Some serializers may implement sequential approach, meaning the data is stored sequentially in a predefined order (likebinary message). Other serializers may implement a "name-value" approach with random access (like SOAP message). The name parameter being described is used in latter case and ignored otherwise.
  • asClass:(Class)class: When deserializing complex types like arrays or structures, it is required to specify the class of the instance the deserializer should create. This parameter is necessary because all arrays and structures are descendants of ROArray and ROComplexType classes respectively and there may be no concrete class information in the message data.

Location


Required Methods


readAnsiStringWithName:

- (nullable NSString *) readAnsiStringWithName:(nullable NSString *)aName

Parameters:

  • aName:

readAnsiStringWithName:asClass:  deprecated

- (nullable NSString *) readAnsiStringWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readArrayWithName:asClass:  deprecated

- (nullable ROArray *) readArrayWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readBinaryWithName:

- (nullable NSData *) readBinaryWithName:(nullable NSString *)aName

Parameters:

  • aName:

readBinaryWithName:asClass:  deprecated

- (nullable NSData *) readBinaryWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readBooleanWithName:

Deserializes a boolean value.

- (BOOL) readBooleanWithName:(nullable NSString *)aName

Parameters:

  • aName: The name of the value.

readByteWithName:

Deserializes a byte value.

- (byte) readByteWithName:(nullable NSString *)aName

Parameters:

  • aName: The name of the value.

readComplexWithName:asClass:

- (nullable ROComplexType *) readComplexWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readCurrencyWithName:

- (nullable NSDecimalNumber *) readCurrencyWithName:(nullable NSString *)aName

Parameters:

  • aName:

readCurrencyWithName:asClass:  deprecated

- (nullable NSDecimalNumber *) readCurrencyWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readDateTimeWithName:

- (nullable NSDate *) readDateTimeWithName:(nullable NSString *)aName

Parameters:

  • aName:

readDateTimeWithName:asClass:  deprecated

- (nullable NSDate *) readDateTimeWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readDecimalWithName:

- (nullable NSDecimalNumber *) readDecimalWithName:(nullable NSString *)aName

Parameters:

  • aName:

readDecimalWithName:asClass:  deprecated

- (nullable NSDecimalNumber *) readDecimalWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readDoubleWithName:

- (double) readDoubleWithName:(nullable NSString *)aName

Parameters:

  • aName:

readEnumWithName:asEnum:

- (NSUInteger) readEnumWithName:(nullable NSString *)aName asEnum:(nonnull ROEnumMetaData *)aEnumMetaData

Parameters:

  • aName:
  • aEnumMetaData:

readGuidWithName:

- (nullable ROGuid *) readGuidWithName:(nullable NSString *)aName

Parameters:

  • aName:

readGuidWithName:asClass:  deprecated

- (nullable ROGuid *) readGuidWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readInt16WithName:

Deserializes a 16-bit signed integer value.

- (int16) readInt16WithName:(nullable NSString *)aName

Parameters:

  • aName:

readInt32WithName:

Deserializes a 32-bit signed integer value.

- (int32) readInt32WithName:(nullable NSString *)aName

Parameters:

  • aName: The name of the value.

readInt64WithName:

Deserializes a 64-bit signed integer value.

- (int64) readInt64WithName:(nullable NSString *)aName

Parameters:

  • aName:

readMutableArrayWithName:asClass:

- (nullable ROMutableArray *) readMutableArrayWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readUtf8StringWithName:

- (nullable NSString *) readUtf8StringWithName:(nullable NSString *)aName

Parameters:

  • aName:

readUtf8StringWithName:asClass:  deprecated

- (nullable NSString *) readUtf8StringWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readVariantWithName:

- (nullable ROVariant *) readVariantWithName:(nullable NSString *)aName

Parameters:

  • aName:

readVariantWithName:asClass:  deprecated

- (nullable ROVariant *) readVariantWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readWideStringWithName:

- (nullable NSString *) readWideStringWithName:(nullable NSString *)aName

Parameters:

  • aName:

readWideStringWithName:asClass:  deprecated

- (nullable NSString *) readWideStringWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readXmlWithName:

- (nullable ROXml *) readXmlWithName:(nullable NSString *)aName

Parameters:

  • aName:

readXmlWithName:asClass:  deprecated

- (nullable ROXml *) readXmlWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

readXsDateTimeWithName:

- (nullable NSDate *) readXsDateTimeWithName:(nullable NSString *)aName

Parameters:

  • aName:

readXsDateTimeWithName:asClass:  deprecated

- (nullable NSDate *) readXsDateTimeWithName:(nullable NSString *)aName asClass:(nonnull Class)aClass

Parameters:

  • aName:
  • aClass:

writeAnsiString:withName:

Serializes a Cocoa string as ANSI-encoded (8 bits per char) string.

- (void) writeAnsiString:(nullable NSString *)aString withName:(nullable NSString *)aName

Parameters:

  • aString: The string to serialize.
  • aName: The name of the value.

writeArray:withName:  deprecated

Serializes a custom array.

- (void) writeArray:(nullable ROArray *)aArray withName:(nullable NSString *)aName

Parameters:

  • aArray: The array to serialize.
  • aName: The name of the value.

writeBinary:withName:

Serializes binary stream data.

- (void) writeBinary:(nullable NSData *)aBinary withName:(nullable NSString *)aName

Parameters:

  • aBinary: The binary stream instance to serialize.
  • aName: The name of the value.

writeBoolean:withName:

Serializes a boolean value.

- (void) writeBoolean:(BOOL)aBoolean withName:(nullable NSString *)aName

Parameters:

  • aBoolean: The value to serialize.
  • aName: The name of the value.

writeByte:withName:

Serializes a byte value.

- (void) writeByte:(byte)aByte withName:(nullable NSString *)aName

Parameters:

  • aByte: The value to serialize.
  • aName: The name of the value.

writeComplex:withName:

Serializes a complex type (i.e. structure) instance.

- (void) writeComplex:(nullable ROComplexType *)aComplex withName:(nullable NSString *)aName

Parameters:

  • aComplex: The complex type instance to serialize.
  • aName: The name of the value.

writeCurrency:withName:

Serializes a currency value.

- (void) writeCurrency:(nullable NSDecimalNumber *)aCurrency withName:(nullable NSString *)aName

Parameters:

  • aCurrency: The value to serialize.
  • aName: The name of the value.

writeDateTime:withName:

Serializes a date/time value.

- (void) writeDateTime:(nullable NSDate *)aDate withName:(nullable NSString *)aName

Parameters:

  • aDate: The value to serialize.
  • aName: The name of the value.

writeDecimal:withName:

Serializes a fixed-point decimal value.

- (void) writeDecimal:(nullable NSDecimalNumber *)aDecimal withName:(nullable NSString *)aName

Parameters:

  • aDecimal: The value to serialize.
  • aName: The name of the value.

writeDouble:withName:

Serializes a floating-point double precision value.

- (void) writeDouble:(double)aDouble withName:(nullable NSString *)aName

Parameters:

  • aDouble: The value to serialize.
  • aName: The name of the value.

writeEnum:withName:  deprecated

- (void) writeEnum:(NSUInteger)aEnum withName:(nullable NSString *)aName

Parameters:

  • aEnum:
  • aName:

writeEnum:withName:asEnum:

- (void) writeEnum:(NSUInteger)aEnum withName:(nullable NSString *)aName asEnum:(nonnull ROEnumMetaData *)aEnumMetaData

Parameters:

  • aEnum:
  • aName:
  • aEnumMetaData:

writeGuid:withName:

Serializes a GUID value.

- (void) writeGuid:(nullable ROGuid *)value withName:(nullable NSString *)aName

Parameters:

  • value: The value to serialize.
  • aName: The name of the value.

writeInt16:withName:

Serializes a 16 bit signed integer value.

- (void) writeInt16:(int16)aInt withName:(nullable NSString *)aName

Parameters:

  • aInt: The value to serialize.
  • aName: The name of the value.

writeInt32:withName:

Serializes a 32 bit signed integer value.

- (void) writeInt32:(int32)aInt withName:(nullable NSString *)aName

Parameters:

  • aInt: The value to serialize.
  • aName: The name of the value.

writeInt64:withName:

Serializes a 64 bit signed integer value.

- (void) writeInt64:(int64)aInt withName:(nullable NSString *)aName

Parameters:

  • aInt: The value to serialize.
  • aName: The name of the value.

writeMutableArray:withName:

- (void) writeMutableArray:(nullable ROMutableArray *)aArray withName:(nullable NSString *)aName

Parameters:

  • aArray:
  • aName:

writeUtf8String:withName:

Serializes a Cocoa string as UTF-8 unicode string.

- (void) writeUtf8String:(nullable NSString *)aString withName:(nullable NSString *)aName

Parameters:

  • aString: The string to serialize.
  • aName: The name of the value.

writeVariant:withName:

Serializes a Delphi-like variant value.
WARNING
The method is provided for future RO SDK/OSX improvement. Variants are not supported in the current RO SDK/OSX version, so you should only code the method stub in classes that implement this protocol.

- (void) writeVariant:(nullable ROVariant *)aVariant withName:(nullable NSString *)aName

Parameters:

  • aVariant: The value to serialize.
  • aName: The name of the value.

writeWideString:withName:

Serializes a Cocoa string as UTF-16 unicode string.

- (void) writeWideString:(nullable NSString *)aString withName:(nullable NSString *)aName

Parameters:

  • aString: The string to serialize.
  • aName: The name of the value.

writeXml:withName:

Serializes an XML value.

- (void) writeXml:(nullable ROXml *)aXml withName:(nullable NSString *)aName

Parameters:

  • aXml: The value to serialize.
  • aName: The name of the value.

writeXsDateTime:withName:

- (void) writeXsDateTime:(nullable NSDate *)aDate withName:(nullable NSString *)aName

Parameters:

  • aDate:
  • aName: