Пример #1
0
    public void checkSUnknown(Ice.AnyClass obj, Ice.Current current)
    {
        test(obj is SUnknown);
        SUnknown su = (SUnknown)obj;

        test(su.su.Equals("SUnknown.su"));
    }
Пример #2
0
        internal void FirstSliceInit(AnyClass v, bool setSlicedData)
        {
            Debug.Assert(_current != null);

            // Add the instance to the map/list of instances. This must be done before reading the instances (for
            // circular references).
            _instanceMap ??= new List <AnyClass>();
            _instanceMap.Add(v);

            // Read all the deferred indirection tables now that the instance is inserted in _instanceMap.
            if (_current.DeferredIndirectionTableList?.Count > 0)
            {
                int savedPos = _pos;

                Debug.Assert(_current.Slices?.Count == _current.DeferredIndirectionTableList.Count);
                for (int i = 0; i < _current.DeferredIndirectionTableList.Count; ++i)
                {
                    int pos = _current.DeferredIndirectionTableList[i];
                    if (pos > 0)
                    {
                        _pos = pos;
                        _current.Slices[i].Instances = Array.AsReadOnly(ReadIndirectionTable());
                    }
                    // else remains empty
                }
                _pos = savedPos;
            }

            if (setSlicedData)
            {
                v.SlicedData = GetSlicedData();
            }
        }
Пример #3
0
    public Task checkSUnknownAsync(Ice.AnyClass obj, Ice.Current current)
    {
        test(obj is SUnknown);
        SUnknown su = (SUnknown)obj;

        test(su.su.Equals("SUnknown.su"));
        return(null);
    }
Пример #4
0
        public void IceStartFirstSlice(string typeId, AnyClass v, bool setSlicedData = false)
        {
            Debug.Assert(InEncapsulation);
            Debug.Assert(_current != null && (_current.SliceTypeId == null || _current.SliceTypeId == typeId));
            Debug.Assert(_current.InstanceType == InstanceType.Class);

            FirstSliceInit(v, setSlicedData);
            ReadIndirectionTableIntoCurrent();
        }
Пример #5
0
        private AnyClass[] ReadIndirectionTable()
        {
            int size = ReadAndCheckSeqSize(1);

            if (size == 0)
            {
                throw new InvalidDataException("invalid empty indirection table");
            }
            var indirectionTable = new AnyClass[size];

            for (int i = 0; i < indirectionTable.Length; ++i)
            {
                int index = ReadSize();
                if (index < 1)
                {
                    throw new InvalidDataException($"read invalid index {index} in indirection table");
                }
                indirectionTable[i] = ReadInstance(index);
            }
            return(indirectionTable);
        }