1 // 2 // Copyright (c) ZeroC, Inc. All rights reserved. 3 // 4 5 namespace Ice 6 { 7 /// <summary> 8 /// Unknown sliced value holds an instance of an unknown Slice class type. 9 /// </summary> 10 public sealed class UnknownSlicedValue : Value 11 { 12 /// <summary> 13 /// Represents an instance of a Slice class type having the given Slice type. 14 /// </summary> 15 /// <param name="unknownTypeId">The Slice type ID of the unknown object.</param> UnknownSlicedValue(string unknownTypeId)16 public UnknownSlicedValue(string unknownTypeId) 17 { 18 _unknownTypeId = unknownTypeId; 19 } 20 21 /// <summary> 22 /// Returns the sliced data if the value has a preserved-slice base class and has been sliced during 23 /// un-marshaling of the value, null is returned otherwise. 24 /// </summary> 25 /// <returns>The sliced data or null.</returns> ice_getSlicedData()26 public override SlicedData ice_getSlicedData() 27 { 28 return _slicedData; 29 } 30 31 /// <summary> 32 /// Returns the Slice type ID associated with this object. 33 /// </summary> 34 /// <returns>The type ID.</returns> ice_id()35 public override string ice_id() 36 { 37 return _unknownTypeId; 38 } 39 iceWrite(OutputStream ostr)40 public override void iceWrite(OutputStream ostr) 41 { 42 ostr.startValue(_slicedData); 43 ostr.endValue(); 44 } 45 iceRead(InputStream istr)46 public override void iceRead(InputStream istr) 47 { 48 istr.startValue(); 49 _slicedData = istr.endValue(true); 50 } 51 52 private string _unknownTypeId; 53 private SlicedData _slicedData; 54 } 55 } 56