// // Copyright (c) ZeroC, Inc. All rights reserved. // #import #import // for ICEFormatType #import // // Forward declarations // @class ICEObject; @protocol ICEObjectPrx; @protocol ICESlicedData; @class ICEUserException; @class ICEEncodingVersion; ICE_API @interface ICEInternalPrefixTable : NSObject @end typedef enum { ICEOptionalFormatF1 = 0, ICEOptionalFormatF2 = 1, ICEOptionalFormatF4 = 2, ICEOptionalFormatF8 = 3, ICEOptionalFormatSize = 4, ICEOptionalFormatVSize = 5, ICEOptionalFormatFSize = 6, ICEOptionalFormatClass = 7 } ICEOptionalFormat; ICE_API @protocol ICEReadObjectCallback -(void)invoke:(ICEObject*)obj; @end // // ICENone singleton to specify not set optionals. // extern id ICENone; typedef struct { Class key; Class value; } ICEKeyValueTypeHelper; ICE_API @protocol ICEInputStream -(void) setSliceValues:(BOOL)b; -(BOOL) readBool; -(NSMutableData*) newBoolSeq; -(NSMutableData*) readBoolSeq; -(ICEByte) readByte; -(NSMutableData*) newByteSeq; -(NSMutableData*) readByteSeq; -(NSData*) readByteSeqNoCopy; -(ICEShort) readShort; -(NSMutableData*) newShortSeq; -(NSMutableData*) readShortSeq; -(ICEInt) readInt; -(NSMutableData*) newIntSeq; -(NSMutableData*) readIntSeq; -(ICELong) readLong; -(NSMutableData*) newLongSeq; -(NSMutableData*) readLongSeq; -(ICEFloat) readFloat; -(NSMutableData*) newFloatSeq; -(NSMutableData*) readFloatSeq; -(ICEDouble) readDouble; -(NSMutableData*) newDoubleSeq; -(NSMutableData*) readDoubleSeq; -(NSMutableString*) newString; -(NSMutableString*) readString; -(NSMutableArray*) newStringSeq; -(NSMutableArray*) readStringSeq; -(ICEInt) readEnumerator:(ICEInt)min max:(ICEInt)max; -(NSMutableData*) newEnumSeq:(ICEInt)min max:(ICEInt)max; -(NSMutableData*) readEnumSeq:(ICEInt)min max:(ICEInt)max; -(id) newProxy:(Class)c; -(id) readProxy:(Class)c; -(void) newValue:(ICEObject*ICE_STRONG_QUALIFIER*)object; -(void) newValue:(ICEObject*ICE_STRONG_QUALIFIER*)object expectedType:(Class)type; -(void) readValue:(ICEObject**)object; -(void) readValue:(ICEObject**)object expectedType:(Class)type; -(NSMutableArray*) newValueSeq:(Class)expectedType; -(NSMutableArray*) readValueSeq:(Class)expectedType; -(NSMutableDictionary*) newValueDict:(Class)keyType expectedType:(Class)type; -(NSMutableDictionary*) readValueDict:(Class)keyType expectedType:(Class)type; -(NSMutableArray*) newSequence:(Class)type; -(NSMutableArray*) readSequence:(Class)type; -(NSMutableDictionary*) newDictionary:(ICEKeyValueTypeHelper)type; -(NSMutableDictionary*) readDictionary:(ICEKeyValueTypeHelper)type; -(BOOL) readOptional:(ICEInt)tag format:(ICEOptionalFormat)format; -(ICEInt) readSize; -(ICEInt) readAndCheckSeqSize:(ICEInt)minSize; -(void) throwException; -(void) startValue; -(id) endValue:(BOOL)preserve NS_RETURNS_RETAINED; -(void) startException; -(id) endException:(BOOL)preserve NS_RETURNS_RETAINED; -(void) startSlice; -(void) endSlice; -(void) skipSlice; -(ICEEncodingVersion*) startEncapsulation; -(void) endEncapsulation; -(ICEEncodingVersion*) skipEmptyEncapsulation; -(ICEEncodingVersion*) skipEncapsulation; -(ICEEncodingVersion*) getEncoding; -(void) readPendingValues; -(void) rewind; -(void) skip:(ICEInt)sz; -(void) skipSize; @end ICE_API @protocol ICEOutputStream -(void) writeBool:(BOOL)v; -(void) writeBoolSeq:(NSData*)v; -(void) writeByte:(ICEByte)v; -(void) writeByteSeq:(NSData*)v; -(void) writeShort:(ICEShort)v; -(void) writeShortSeq:(NSData*)v; -(void) writeInt:(ICEInt)v; -(void) writeIntSeq:(NSData*)v; -(void) writeLong:(ICELong)v; -(void) writeLongSeq:(NSData*)v; -(void) writeFloat:(ICEFloat)v; -(void) writeFloatSeq:(NSData*)v; -(void) writeDouble:(ICEDouble)v; -(void) writeDoubleSeq:(NSData*)v; -(void) writeString:(NSString*)v; -(void) writeStringSeq:(NSArray*)v; -(void) writeEnumerator:(ICEInt)v min:(ICEInt)min max:(ICEInt)max; -(void) writeEnumSeq:(NSData*)v min:(ICEInt)min max:(ICEInt)max; -(void) writeProxy:(id)v; -(void) writeValue:(ICEObject*)v; -(void) writeValueSeq:(NSArray*)v; -(void) writeValueDict:(NSDictionary*)v helper:(Class)helper; -(void) writeSequence:(NSArray*)arr helper:(Class)helper; -(void) writeDictionary:(NSDictionary*)dictionary helper:(ICEKeyValueTypeHelper)helper; -(BOOL) writeOptional:(ICEInt)tag format:(ICEOptionalFormat)format; -(void) writeSize:(ICEInt)v; -(void) writeException:(ICEUserException*)v; -(void) startValue:(id)slicedData; -(void) endValue; -(void) startException:(id)slicedData; -(void) endException; -(void) startSlice:(NSString*)typeId compactId:(ICEInt)compactId lastSlice:(BOOL)lastSlice; -(void) endSlice; -(void) startEncapsulation; -(void) startEncapsulation:(ICEEncodingVersion*)encoding format:(ICEFormatType)format; -(void) endEncapsulation; -(ICEEncodingVersion*) getEncoding; -(void) writePendingValues; -(NSMutableData*) finished; -(NSData*) finishedNoCopy; -(void) reset:(BOOL)clearBuffer; @end // // Helper protocol implemented by helpers for marshaling/un-marshaling // Slice types. // ICE_API @protocol ICEStreamHelper +(id) readRetained:(id)stream NS_RETURNS_RETAINED; +(id) read:(id)stream; +(void) write:(id)obj stream:(id)stream; +(id) readOptionalRetained:(id)stream tag:(ICEInt)tag; +(id) readOptional:(id)stream tag:(ICEInt)tag; +(void) writeOptional:(id)obj stream:(id)stream tag:(ICEInt)tag; +(ICEInt) minWireSize; @end ICE_API @interface ICEStreamHelper : NSObject @end // // Helper classes for streaming Slice types // ICE_API @interface ICEBoolHelper : ICEStreamHelper @end ICE_API @interface ICEByteHelper : ICEStreamHelper @end ICE_API @interface ICEShortHelper : ICEStreamHelper @end ICE_API @interface ICEIntHelper : ICEStreamHelper @end ICE_API @interface ICELongHelper : ICEStreamHelper @end ICE_API @interface ICEFloatHelper : ICEStreamHelper @end ICE_API @interface ICEDoubleHelper : ICEStreamHelper @end ICE_API @interface ICEStringHelper : ICEStreamHelper @end ICE_API @interface ICEObjectHelper : ICEStreamHelper +(void)read:(ICEObject**)v stream:(id)stream; +(void)readOptional:(id*)v stream:(id)stream tag:(ICEInt)tag; @end ICE_API @interface ICEProxyHelper : ICEStreamHelper @end ICE_API @interface ICEEnumHelper : ICEStreamHelper +(ICEInt) getMinValue; +(ICEInt) getMaxValue; @end ICE_API @interface ICEStructHelper : ICEStreamHelper +(void) readRetained:(id)stream value:(id ICE_STRONG_QUALIFIER*)v; +(void) read:(id)stream value:(id*)v; +(Class) getOptionalHelper; @end ICE_API @protocol ICESequenceStreamHelper +(Class) getElementHelper; +(ICEInt) count:(id)obj; @end ICE_API @interface ICEArraySequenceHelper : ICEStreamHelper +(Class) getOptionalHelper; @end ICE_API @interface ICEDataSequenceHelper : ICEStreamHelper @end ICE_API @interface ICEBoolSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEByteSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEShortSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEIntSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICELongSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEFloatSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEDoubleSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEEnumSequenceHelper : ICEDataSequenceHelper @end ICE_API @interface ICEStringSequenceHelper : ICEArraySequenceHelper @end ICE_API @interface ICEObjectSequenceHelper : ICEArraySequenceHelper @end ICE_API @interface ICEProxySequenceHelper : ICEArraySequenceHelper @end ICE_API @protocol ICEDictionaryStreamHelper +(ICEInt) count:(id)obj; @end ICE_API @interface ICEDictionaryHelper : ICEStreamHelper +(Class) getOptionalHelper; @end ICE_API @interface ICEObjectDictionaryHelper : ICEDictionaryHelper @end // // Helper for optionals // ICE_API @protocol ICEOptionalStreamHelper +(id) readRetained:(id)stream helper:(Class)helper NS_RETURNS_RETAINED; +(void) write:(id)obj stream:(id)stream helper:(Class)helper; +(ICEOptionalFormat) optionalFormat; @end ICE_API @interface ICEFixedLengthOptionalHelper : NSObject @end ICE_API @interface ICEVarLengthOptionalHelper : NSObject @end ICE_API @interface ICEFixedSequenceOptionalHelper : NSObject @end ICE_API @interface ICEFixedSize1SequenceOptionalHelper : NSObject @end ICE_API @interface ICEFixedDictionaryOptionalHelper : NSObject @end ICE_API @interface CompactIdMapHelper : NSObject +(void) initialize; +(void) registerClass:(NSString*)type value:(ICEInt)value; @end ICE_API @interface ICEOptionalGetter : NSObject +(BOOL) get:(id)value value:(id ICE_STRONG_QUALIFIER*)v type:(Class)cl; +(BOOL) getRetained:(id)value value:(id ICE_STRONG_QUALIFIER*)v type:(Class)cl; +(BOOL) getByte:(id)value value:(ICEByte*)v; +(BOOL) getBool:(id)value value:(BOOL*)v; +(BOOL) getShort:(id)value value:(ICEShort*)v; +(BOOL) getInt:(id)value value:(ICEInt*)v; +(BOOL) getLong:(id)value value:(ICELong*)v; +(BOOL) getFloat:(id)value value:(ICEFloat*)v; +(BOOL) getDouble:(id)value value:(ICEDouble*)v; @end