Ejemplo n.º 1
0
        public ExpandRet ExpandEntries_OrThrow(uint newEntriesCt, LimitEntries limits, bool throwOnNoChange = false)
        {
            ExpandRet ret = this.ExpandEntries(newEntriesCt, limits);

            this.ThrowErrorForExpandReturn(ret, throwOnNoChange);
            return(ret);
        }
Ejemplo n.º 2
0
 public ExpandRet ExpandEntries(uint newEntriesCt, LimitEntries limits)
 {
     return
         (this._ExpandSize(
              newEntriesCt * limits.dataTypeSize,
              limits.minEntries * limits.dataTypeSize,
              limits.maxEntries * limits.dataTypeSize));
 }
Ejemplo n.º 3
0
        public DefTable(int index, Bin.TypeID type, uint initialElements, uint minEntries, uint maxEntries)
        {
            this.index       = index;
            this.defSegments = new List <DefSegment>();

            uint typeSize = DataStore.GetTypeIDSize(type);

            this.type     = type;
            this.elements = initialElements;
            this.limits   =
                new LimitEntries(
                    typeSize,
                    minEntries,
                    maxEntries);
        }
Ejemplo n.º 4
0
        public DataStore(uint initialEntryCt, LimitEntries limits, List <DefSegment> defaults, ExecutionContext globSrc)
        {
            this.storeAlignment = limits.dataTypeSize;

            this.ExpandEntries_OrThrow(initialEntryCt, limits);

            uint defaultSet = this.WriteDefSegmentsData(defaults, globSrc);

            if (defaultSet != 0)
            {
                uint reEleCt = defaultSet / limits.dataTypeSize;
                if (defaultSet % limits.dataTypeSize != 0)
                {
                    ++reEleCt;
                }

                this.ExpandEntries_OrThrow(reEleCt, limits);
                if (this.WriteDefSegmentsData(defaults, globSrc) != 0)
                {
                    throw new System.Exception("Unknown issue setting default store values for Table.");
                }
            }
        }