| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | #nullable enable |
| | 4 | |
|
| | 5 | | using System.ComponentModel; |
| | 6 | |
|
| | 7 | | namespace Ice; |
| | 8 | |
|
| | 9 | | public abstract class Value |
| | 10 | | { |
| | 11 | | private const string _id = "::Ice::Object"; |
| | 12 | |
|
| | 13 | | /// <summary> |
| | 14 | | /// Returns the Slice type ID of the interface supported by this object. |
| | 15 | | /// </summary> |
| | 16 | | /// <returns>The return value is always ::Ice::Object.</returns> |
| 1 | 17 | | public static string ice_staticId() => _id; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Returns the Slice type ID of the most-derived interface supported by this object. |
| | 21 | | /// </summary> |
| | 22 | | /// <returns>The return value is always ::Ice::Object.</returns> |
| 0 | 23 | | public virtual string ice_id() => _id; |
| | 24 | |
|
| | 25 | | /// <summary> |
| | 26 | | /// The Ice run time invokes this method prior to marshaling an object's data members. This allows a subclass |
| | 27 | | /// to override this method in order to validate its data members. |
| | 28 | | /// </summary> |
| | 29 | | public virtual void ice_preMarshal() |
| | 30 | | { |
| 1 | 31 | | } |
| | 32 | |
|
| | 33 | | /// <summary> |
| | 34 | | /// This Ice run time invokes this method after unmarshaling an object's data members. This allows a |
| | 35 | | /// subclass to override this method in order to perform additional initialization. |
| | 36 | | /// </summary> |
| | 37 | | public virtual void ice_postUnmarshal() |
| | 38 | | { |
| 1 | 39 | | } |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Returns the sliced data if the value has a preserved-slice base class and has been sliced during |
| | 43 | | /// un-marshaling of the value, null is returned otherwise. |
| | 44 | | /// </summary> |
| | 45 | | /// <returns>The sliced data or null.</returns> |
| 1 | 46 | | public SlicedData? ice_getSlicedData() => _slicedData; |
| | 47 | |
|
| | 48 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 49 | | public virtual void iceWrite(OutputStream ostr) |
| | 50 | | { |
| 1 | 51 | | ostr.startValue(_slicedData); |
| 1 | 52 | | iceWriteImpl(ostr); |
| 1 | 53 | | ostr.endValue(); |
| 1 | 54 | | } |
| | 55 | |
|
| | 56 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 57 | | public virtual void iceRead(InputStream istr) |
| | 58 | | { |
| 1 | 59 | | istr.startValue(); |
| 1 | 60 | | iceReadImpl(istr); |
| 1 | 61 | | _slicedData = istr.endValue(); |
| 1 | 62 | | } |
| | 63 | |
|
| | 64 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 65 | | protected virtual void iceWriteImpl(OutputStream ostr) |
| | 66 | | { |
| 1 | 67 | | } |
| | 68 | |
|
| | 69 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 70 | | protected virtual void iceReadImpl(InputStream istr) |
| | 71 | | { |
| 1 | 72 | | } |
| | 73 | |
|
| | 74 | | /// <summary> |
| | 75 | | /// Returns a copy of the object. The cloned object contains field-for-field copies |
| | 76 | | /// of the state. |
| | 77 | | /// </summary> |
| | 78 | | /// <returns>The cloned object.</returns> |
| 1 | 79 | | public Value Clone() => (Value)MemberwiseClone(); |
| | 80 | |
|
| | 81 | | private SlicedData? _slicedData; |
| | 82 | | } |