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


readAnsiString:withName:asClass:  deprecated

- (void) readAnsiString:(NSString **)aString withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aString:
  • aName:
  • aClass:

readAnsiStringWithName:asClass:

Deserializes an ANSI-encoded (8 bits per char) string.

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

Parameters:

  • aName:
  • aClass:

readArray:withName:asClass:  deprecated

- (void) readArray:(ROArray **)aArray withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aArray:
  • aName:
  • aClass:

readArrayWithName:asClass:

Deserializes a custom array.

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

Parameters:

  • aName:
  • aClass:

readBinary:withName:asClass:  deprecated

- (void) readBinary:(NSData **)aBinary withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aBinary:
  • aName:
  • aClass:

readBinaryWithName:asClass:

Deserializes a binary stream data.

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

Parameters:

  • aName:
  • aClass:

readBoolean:withName:  deprecated

- (void) readBoolean:(BOOL *)aInt withName:(NSString *)aName

Parameters:

  • aInt:
  • aName:

readBooleanWithName:

Deserializes a boolean value.

- (BOOL) readBooleanWithName:(NSString *)aName

Parameters:

  • aName: The name of the value.

readByte:withName:  deprecated

- (void) readByte:(byte *)aByte withName:(NSString *)aName

Parameters:

  • aByte:
  • aName:

readByteWithName:

Deserializes a byte value.

- (byte) readByteWithName:(NSString *)aName

Parameters:

  • aName: The name of the value.

readComplex:withName:asClass:  deprecated

- (void) readComplex:(ROComplexType **)aComplex withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aComplex:
  • aName:
  • aClass:

readComplexWithName:asClass:

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

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

Parameters:

  • aName: The name of the value.
  • aClass:

readCurrency:withName:asClass:  deprecated

- (void) readCurrency:(NSDecimalNumber **)aDecimal withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aDecimal:
  • aName:
  • aClass:

readCurrencyWithName:asClass:

Deserializes a currency value.

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

Parameters:

  • aName: The name of the value.
  • aClass:

readDateTime:withName:asClass:  deprecated

- (void) readDateTime:(NSDate **)aDate withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aDate:
  • aName:
  • aClass:

readDateTimeWithName:asClass:

Deserializes a date/time value.

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

Parameters:

  • aName: The name of the value.
  • aClass:

readDecimal:withName:asClass:  deprecated

- (void) readDecimal:(NSDecimalNumber **)aDecimal withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aDecimal:
  • aName:
  • aClass:

readDecimalWithName:asClass:

Deserializes a fixed-point decimal value.

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

Parameters:

  • aName: The name of the value.
  • aClass:

readDouble:withName:  deprecated

- (void) readDouble:(double *)aDouble withName:(NSString *)aName

Parameters:

  • aDouble:
  • aName:

readDoubleWithName:

- (double) readDoubleWithName:(NSString *)aName

Parameters:

  • aName:

readEnum:withName:  deprecated

- (void) readEnum:(int32 *)aEnum withName:(NSString *)aName

Parameters:

  • aEnum:
  • aName:

readEnum:withName:asEnum:

- (void) readEnum:(int32 *)aEnum withName:(NSString *)aName asEnum:(ROEnumMetaData *)aEnumMetaData

Parameters:

  • aEnum:
  • aName:
  • aEnumMetaData:

readEnumWithName:asEnum:

- (int32) readEnumWithName:(NSString *)aName asEnum:(ROEnumMetaData *)aEnumMetaData

Parameters:

  • aName:
  • aEnumMetaData:

readGuid:withName:asClass:  deprecated

- (void) readGuid:(ROGuid **)value withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • value:
  • aName:
  • aClass:

readGuidWithName:asClass:

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

Parameters:

  • aName:
  • aClass:

readInt16:withName:  deprecated

- (void) readInt16:(int16 *)aInt withName:(NSString *)aName

Parameters:

  • aInt:
  • aName:

readInt16WithName:

Deserializes a 16-bit signed integer value.

- (int16) readInt16WithName:(NSString *)aName

Parameters:

  • aName:

readInt32:withName:  deprecated

- (void) readInt32:(int32 *)aInt withName:(NSString *)aName

Parameters:

  • aInt:
  • aName:

readInt32WithName:

Deserializes a 32-bit signed integer value.

- (int32) readInt32WithName:(NSString *)aName

Parameters:

  • aName: The name of the value.

readInt64:withName:  deprecated

- (void) readInt64:(int64 *)aInt withName:(NSString *)aName

Parameters:

  • aInt:
  • aName:

readInt64WithName:

Deserializes a 64-bit signed integer value.

- (int64) readInt64WithName:(NSString *)aName

Parameters:

  • aName:

readNativeArrayWithName:asClass:

- (NSArray *) readNativeArrayWithName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aName:
  • aClass:

readUtf8String:withName:asClass:  deprecated

- (void) readUtf8String:(NSString **)aString withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aString:
  • aName:
  • aClass:

readUtf8StringWithName:asClass:

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

Parameters:

  • aName:
  • aClass:

readVariant:withName:asClass:  deprecated

- (void) readVariant:(ROVariant **)aVariant withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aVariant:
  • aName:
  • aClass:

readVariantWithName:asClass:

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

Parameters:

  • aName:
  • aClass:

readWideString:withName:asClass:  deprecated

- (void) readWideString:(NSString **)aString withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aString:
  • aName:
  • aClass:

readWideStringWithName:asClass:

Deserializes a UTF-16 encoded unicode string.

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

Parameters:

  • aName:
  • aClass:

readXml:withName:asClass:  deprecated

Deserializes an XML value.

- (void) readXml:(ROXml **)aXml withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aXml: The reference to the variable to store the deserialized value.
  • aName: The name of the value.
  • aClass:

readXmlWithName:asClass:

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

Parameters:

  • aName:
  • aClass:

readXsDateTime:withName:asClass:  deprecated

- (void) readXsDateTime:(NSDate **)aDate withName:(NSString *)aName asClass:(Class)aClass

Parameters:

  • aDate:
  • aName:
  • aClass:

readXsDateTimeWithName:asClass:

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

Parameters:

  • aName:
  • aClass:

writeAnsiString:withName:

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

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

Parameters:

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

writeArray:withName:

Serializes a custom array.

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

Parameters:

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

writeBinary:withName:

Serializes binary stream data.

- (void) writeBinary:(NSData *)aBinary withName:(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:(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:(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:(ROComplexType *)aComplex withName:(NSString *)aName

Parameters:

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

writeCurrency:withName:

Serializes a currency value.

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

Parameters:

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

writeDateTime:withName:

Serializes a date/time value.

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

Parameters:

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

writeDecimal:withName:

Serializes a fixed-point decimal value.

- (void) writeDecimal:(NSDecimalNumber *)aDecimal withName:(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:(NSString *)aName

Parameters:

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

writeEnum:withName:  deprecated

- (void) writeEnum:(int32)aEnum withName:(NSString *)aName

Parameters:

  • aEnum:
  • aName:

writeEnum:withName:asEnum:

Serializes an enumerated type value.

- (void) writeEnum:(int32)aEnum withName:(NSString *)aName asEnum:(ROEnumMetaData *)aEnumMetaData

Parameters:

  • aEnum: The enumerated value to serialize. The actual enum value should be casted to 32 bit integer to use this method.
  • aName: The name of the value.
  • aEnumMetaData: The enum metadata class describing the enumerated type being serialized.

writeGuid:withName:

Serializes a GUID value.

- (void) writeGuid:(ROGuid *)value withName:(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:(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:(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:(NSString *)aName

Parameters:

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

writeUtf8String:withName:

Serializes a Cocoa string as UTF-8 unicode string.

- (void) writeUtf8String:(NSString *)aString withName:(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:(ROVariant *)aVariant withName:(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:(NSString *)aString withName:(NSString *)aName

Parameters:

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

writeXml:withName:

Serializes an XML value.

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

Parameters:

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

writeXsDateTime:withName:

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

Parameters:

  • aDate:
  • aName: