private bool ReadOrThrow(IRelationQueue queue)
 {
     try
     {
         return(queue.Read());
     }
     catch (Exception ex)
     {
         throw RelationException.CannotForwardQueue(this.Relation, queue.Metadata.Identity, ex);
     }
 }
        public IField this[int index]
        {
            get
            {
                if (index < 0 || index >= this.Degree)
                {
                    throw RelationException.IndexOutOfRange(this.Relation.Header, index);
                }

                return(this.Buffer.Fields[index]);
            }
        }
 private void Validate()
 {
     for (int i = 0; i < this.Attributes.Count; i++)
     {
         if (this.Attributes[i] == null)
         {
             throw RelationException.AttributeCannotBeNull(this.Schema, i);
         }
         else if (!this.Schema.Equals(this.Attributes[i].Schema))
         {
             throw RelationException.AttributeDoesNotBelongToSchema(this.Schema, this.Attributes[i], i);
         }
     }
 }
        private void InitializeHeader()
        {
            if (this.Header.Count != this.InnerReader.Degree)
            {
                throw RelationException.InvalidDataReaderHeader(this.InnerReader.Relation.Header, this.Header);
            }

            this.headerMap = new Dictionary <string, int>();

            for (int i = 0; i < this.Header.Count; i++)
            {
                if (this.Header[i] == null)
                {
                    throw RelationException.DataHeaderCannotBeNull(this.InnerReader.Relation.Header, i);
                }

                if (this.headerMap.ContainsKey(this.Header[i]))
                {
                    throw RelationException.DataHeaderCannotHaveDupes(this.InnerReader.Relation.Header, this.Header, i);
                }

                this.headerMap.Add(this.Header[i], i);
            }
        }