| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using System.Collections.Immutable; |
| | 4 | | using System.ComponentModel; |
| | 5 | |
|
| | 6 | | namespace ZeroC.Slice; |
| | 7 | |
|
| | 8 | | /// <summary>Represents the base class for classes defined in Slice. The Slice keyword AnyClass maps to this class. |
| | 9 | | /// </summary> |
| | 10 | | public abstract class SliceClass |
| | 11 | | { |
| | 12 | | /// <summary>Gets the unknown slices if the class has a preserved-slice base class and has been sliced-off |
| | 13 | | /// during decoding.</summary> |
| 897 | 14 | | public ImmutableList<SliceInfo> UnknownSlices { get; internal set; } = ImmutableList<SliceInfo>.Empty; |
| | 15 | |
|
| 163 | 16 | | internal void Decode(ref SliceDecoder decoder) => DecodeCore(ref decoder); |
| | 17 | |
|
| 275 | 18 | | internal void Encode(ref SliceEncoder encoder) => EncodeCore(ref encoder); |
| | 19 | |
|
| | 20 | | /// <summary>Decodes the properties of this instance.</summary> |
| | 21 | | /// <param name="decoder">The Slice decoder.</param> |
| | 22 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 23 | | protected abstract void DecodeCore(ref SliceDecoder decoder); |
| | 24 | |
|
| | 25 | | /// <summary>Encodes the properties of this instance.</summary> |
| | 26 | | /// <param name="encoder">The Slice encoder.</param> |
| | 27 | | [EditorBrowsable(EditorBrowsableState.Never)] |
| | 28 | | protected abstract void EncodeCore(ref SliceEncoder encoder); |
| | 29 | | } |