< Summary

Information
Class: Ice.Value
Assembly: Ice
File(s): /_/csharp/src/Ice/Value.cs
Tag: 91_21789722663
Line coverage
93%
Covered lines: 15
Uncovered lines: 1
Coverable lines: 16
Total lines: 84
Line coverage: 93.7%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
90%
Covered methods: 9
Total methods: 10
Method coverage: 90%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ice_staticId()100%11100%
ice_id()100%210%
ice_preMarshal()100%11100%
ice_postUnmarshal()100%11100%
ice_getSlicedData()100%11100%
iceWrite(...)100%11100%
iceRead(...)100%11100%
iceWriteImpl(...)100%11100%
iceReadImpl(...)100%11100%
Clone()100%11100%

File(s)

/_/csharp/src/Ice/Value.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3#nullable enable
 4
 5using System.ComponentModel;
 6
 7namespace Ice;
 8
 9/// <summary>
 10/// The base class for instances of Slice-defined classes.
 11/// </summary>
 12public abstract class Value
 13{
 14    private const string _id = "::Ice::Object";
 15
 16    /// <summary>
 17    /// Returns the Slice type ID of this type.
 18    /// </summary>
 19    /// <returns>The return value is always <c>::Ice::Object</c>.</returns>
 120    public static string ice_staticId() => _id;
 21
 22    /// <summary>
 23    /// Returns the Slice type ID of the most-derived class supported by this object.
 24    /// </summary>
 25    /// <returns>The Slice type ID.</returns>
 026    public virtual string ice_id() => _id;
 27
 28    /// <summary>
 29    /// The Ice runtime calls this method before marshaling a class instance.
 30    /// Subclasses can override this method in order to update or validate their fields before marshaling.
 31    /// </summary>
 32    public virtual void ice_preMarshal()
 33    {
 134    }
 35
 36    /// <summary>
 37    /// The Ice runtime calls this method after unmarshaling a class instance.
 38    /// Subclasses can override this method in order to update or validate their fields after unmarshaling.
 39    /// </summary>
 40    public virtual void ice_postUnmarshal()
 41    {
 142    }
 43
 44    /// <summary>
 45    /// Returns the sliced data associated with this instance.
 46    /// </summary>
 47    /// <returns>If this value has a preserved-slice base class and has been sliced during unmarshaling,
 48    /// this returns the sliced data; otherwise this returns null.</returns>
 149    public SlicedData? ice_getSlicedData() => _slicedData;
 50
 51    [EditorBrowsable(EditorBrowsableState.Never)]
 52    public virtual void iceWrite(OutputStream ostr)
 53    {
 154        ostr.startValue(_slicedData);
 155        iceWriteImpl(ostr);
 156        ostr.endValue();
 157    }
 58
 59    [EditorBrowsable(EditorBrowsableState.Never)]
 60    public virtual void iceRead(InputStream istr)
 61    {
 162        istr.startValue();
 163        iceReadImpl(istr);
 164        _slicedData = istr.endValue();
 165    }
 66
 67    [EditorBrowsable(EditorBrowsableState.Never)]
 68    protected virtual void iceWriteImpl(OutputStream ostr)
 69    {
 170    }
 71
 72    [EditorBrowsable(EditorBrowsableState.Never)]
 73    protected virtual void iceReadImpl(InputStream istr)
 74    {
 175    }
 76
 77    /// <summary>
 78    /// Returns a shallow field-for-field copy of this object.
 79    /// </summary>
 80    /// <returns>The cloned object.</returns>
 181    public Value Clone() => (Value)MemberwiseClone();
 82
 83    private SlicedData? _slicedData;
 84}