Ejemplo n.º 1
0
            public void updateSize()
            {
                int newSize = 0;

                for (int i = 0; i < nodeList_.Count; ++i)
                {
                    DerNode n = nodeList_[i];
                    newSize += n.getSize();
                }

                size_         = newSize;
                childChanged_ = false;
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Add a child to this node.
            /// </summary>
            ///
            /// <param name="node">The child node to add.</param>
            /// <param name="notifyParent"></param>
            public void addChild(DerNode node, bool notifyParent)
            {
                node.parent_ = this;
                ILOG.J2CsMapping.Collections.Collections.Add(nodeList_, node);

                if (notifyParent)
                {
                    if (parent_ != null)
                    {
                        parent_.setChildChanged();
                    }
                }

                childChanged_ = true;
            }
Ejemplo n.º 3
0
            /// <summary>
            /// Override the base decode to decode and store the data from an input
            /// buffer. Recursively populates child nodes.
            /// </summary>
            ///
            /// <param name="inputBuf">position.</param>
            /// <param name="startIdx">The offset into the buffer.</param>
            protected internal override void decode(ByteBuffer inputBuf, int startIdx)
            {
                int idx = startIdx;

                size_ = decodeHeader(inputBuf, idx);
                idx  += header_.remaining();

                int accSize = 0;

                while (accSize < size_)
                {
                    DerNode node = net.named_data.jndn.encoding.der.DerNode.parse(inputBuf, idx);
                    idx     += node.getSize();
                    accSize += node.getSize();
                    addChild(node, false);
                }
            }
Ejemplo n.º 4
0
            /// <summary>
            /// Override the base encode to return raw data encoding for this node and
            /// its children
            /// </summary>
            ///
            /// <returns>The raw data encoding.</returns>
            public override Blob encode()
            {
                DynamicByteBuffer temp = new DynamicByteBuffer(10);

                updateSize();
                encodeHeader(size_);
                temp.ensuredPut(header_);

                for (int i = 0; i < nodeList_.Count; ++i)
                {
                    DerNode n            = nodeList_[i];
                    Blob    encodedChild = n.encode();
                    temp.ensuredPut(encodedChild.buf());
                }

                return(new Blob(temp.flippedBuffer(), false));
            }
Ejemplo n.º 5
0
 public void addChild(DerNode node)
 {
     addChild(node, false);
 }
Ejemplo n.º 6
0
 public void addChild(DerNode node)
 {
     addChild(node, false);
 }
Ejemplo n.º 7
0
            /// <summary>
            /// Add a child to this node.
            /// </summary>
            ///
            /// <param name="node">The child node to add.</param>
            /// <param name="notifyParent"></param>
            public void addChild(DerNode node, bool notifyParent)
            {
                node.parent_ = this;
                ILOG.J2CsMapping.Collections.Collections.Add(nodeList_,node);

                if (notifyParent) {
                    if (parent_ != null)
                        parent_.setChildChanged();
                }

                childChanged_ = true;
            }