Example #1
0
        private SubtreeUnpacker(Unpacker root, SubtreeUnpacker parent)
        {
            var internalRoot = root as IRootUnpacker;

#if DEBUG
            Contract.Assert(root != null, "root != null");
            Contract.Assert(internalRoot != null, "root is IRootUnpacker");
            Contract.Assert(internalRoot.CollectionType == CollectionType.Array || internalRoot.CollectionType == CollectionType.Map, "root.IsArrayHeader || root.IsMapHeader");
#endif // DEBUG
            this._root         = root;
            this._internalRoot = internalRoot;
            this._parent       = parent;
            this._unpacked     = new Int64Stack(2);

            this._itemsCount = new Int64Stack(2);
            this._isMap      = new BooleanStack(2);

            if (root.ItemsCount > 0)
            {
                this._itemsCount.Push(root.ItemsCount * (( int )internalRoot.CollectionType));
                this._unpacked.Push(0);
                this._isMap.Push(internalRoot.CollectionType == CollectionType.Map);
            }

            this._state = State.InHead;
        }
Example #2
0
 private SubtreeUnpacker(ItemsUnpacker root, SubtreeUnpacker parent)
 {
     Contract.Assert(root != null);
     Contract.Assert(root.IsArrayHeader || root.IsMapHeader);
     this._root       = root;
     this._parent     = parent;
     this._unpacked   = new Stack <long>(2);
     this._itemsCount = new Stack <long>(2);
     this._isMap      = new Stack <bool>(2);
     if (root.ItemsCount > 0L)
     {
         this._itemsCount.Push(root.ItemsCount * (root.IsMapHeader ? ((long)2) : ((long)1)));
         this._unpacked.Push(0L);
         this._isMap.Push(root.IsMapHeader);
     }
 }
Example #3
0
		private SubtreeUnpacker( StreamUnpacker root, SubtreeUnpacker parent )
		{
			Contract.Assert( root != null );
			Contract.Assert( root.IsArrayHeader || root.IsMapHeader );
			this._root = root;
			this._parent = parent;
			this._unpacked = new Stack<long>( 2 );

			this._itemsCount = new Stack<long>( 2 );
			this._isMap = new Stack<bool>( 2 );

			if ( root.ItemsCount > 0 )
			{
				this._itemsCount.Push( root.ItemsCount * ( root.IsMapHeader ? 2 : 1 ) );
				this._unpacked.Push( 0 );
				this._isMap.Push( root.IsMapHeader );
			}
		}
Example #4
0
        private SubtreeUnpacker(ItemsUnpacker root, SubtreeUnpacker parent)
        {
#if DEBUG
            Contract.Assert(root != null);
            Contract.Assert(root.IsArrayHeader || root.IsMapHeader);
#endif
            this._root     = root;
            this._parent   = parent;
            this._unpacked = new Stack <long>(2);

            this._itemsCount = new Stack <long>(2);
            this._isMap      = new Stack <bool>(2);

            if (root.ItemsCount > 0)
            {
                this._itemsCount.Push(root.InternalItemsCount * (( int )root.InternalCollectionType));
                this._unpacked.Push(0);
                this._isMap.Push(root.InternalCollectionType == ItemsUnpacker.CollectionType.Map);
            }
        }
Example #5
0
		private SubtreeUnpacker( ItemsUnpacker root, SubtreeUnpacker parent )
		{
#if DEBUG && !UNITY_ANDROID && !UNITY_IPHONE
			Contract.Assert( root != null );
			Contract.Assert( root.IsArrayHeader || root.IsMapHeader );
#endif // DEBUG && !UNITY_ANDROID && !UNITY_IPHONE
			this._root = root;
			this._parent = parent;
			this._unpacked = new Stack<long>( 2 );

			this._itemsCount = new Stack<long>( 2 );
			this._isMap = new Stack<bool>( 2 );

			if ( root.ItemsCount > 0 )
			{
				this._itemsCount.Push( root.InternalItemsCount * ( ( int )root.InternalCollectionType ) );
				this._unpacked.Push( 0 );
				this._isMap.Push( root.InternalCollectionType == ItemsUnpacker.CollectionType.Map );
			}
		}
Example #6
0
        private SubtreeUnpacker(ItemsUnpacker root, SubtreeUnpacker parent)
        {
#if DEBUG && !UNITY
            Contract.Assert(root != null, "root != null");
            Contract.Assert(root.IsArrayHeader || root.IsMapHeader, "root.IsArrayHeader || root.IsMapHeader");
#endif // DEBUG && !UNITY
            this._root     = root;
            this._parent   = parent;
            this._unpacked = new Int64Stack(2);

            this._itemsCount = new Int64Stack(2);
            this._isMap      = new BooleanStack(2);

            if (root.ItemsCount > 0)
            {
                this._itemsCount.Push(root.InternalItemsCount * (( int )root.InternalCollectionType));
                this._unpacked.Push(0);
                this._isMap.Push(root.InternalCollectionType == ItemsUnpacker.CollectionType.Map);
            }

            this._state = State.InHead;
        }
Example #7
0
		private SubtreeUnpacker( ItemsUnpacker root, SubtreeUnpacker parent )
		{
#if DEBUG
			Contract.Assert( root != null, "root != null" );
			Contract.Assert( root.IsArrayHeader || root.IsMapHeader, "root.IsArrayHeader || root.IsMapHeader" );
#endif // DEBUG
			this._root = root;
			this._parent = parent;
			this._unpacked = new Int64Stack( 2 );

			this._itemsCount = new Int64Stack( 2 );
			this._isMap = new BooleanStack( 2 );

			if ( root.ItemsCount > 0 )
			{
				this._itemsCount.Push( root.InternalItemsCount * ( ( int )root.InternalCollectionType ) );
				this._unpacked.Push( 0 );
				this._isMap.Push( root.InternalCollectionType == ItemsUnpacker.CollectionType.Map );
			}

			this._state = State.InHead;
		}