// effects: Creates a basic cell relation for query
 internal BasicCellRelation(
     CellQuery cellQuery, ViewCellRelation viewCellRelation,
     IEnumerable<MemberProjectedSlot> slots)
     : base(viewCellRelation.CellNumber)
 {
     m_cellQuery = cellQuery;
     m_slots = new List<MemberProjectedSlot>(slots);
     Debug.Assert(m_slots.Count > 0, "Cell relation with not even an exent?");
     m_viewCellRelation = viewCellRelation;
 }
Exemple #2
0
 // effects: Creates a basic cell relation for query
 internal BasicCellRelation(
     CellQuery cellQuery, ViewCellRelation viewCellRelation,
     IEnumerable <MemberProjectedSlot> slots)
     : base(viewCellRelation.CellNumber)
 {
     m_cellQuery = cellQuery;
     m_slots     = new List <MemberProjectedSlot>(slots);
     Debug.Assert(m_slots.Count > 0, "Cell relation with not even an exent?");
     m_viewCellRelation = viewCellRelation;
 }
 internal BasicCellRelation(
     CellQuery cellQuery,
     ViewCellRelation viewCellRelation,
     IEnumerable <MemberProjectedSlot> slots)
     : base(viewCellRelation.CellNumber)
 {
     this.m_cellQuery        = cellQuery;
     this.m_slots            = new List <MemberProjectedSlot>(slots);
     this.m_viewCellRelation = viewCellRelation;
 }
        internal ViewKeyConstraint Propagate()
        {
            ViewCellRelation    viewCellRelation = this.CellRelation.ViewCellRelation;
            List <ViewCellSlot> viewCellSlotList = new List <ViewCellSlot>();

            foreach (MemberProjectedSlot keySlot in this.KeySlots)
            {
                ViewCellSlot viewCellSlot = viewCellRelation.LookupViewSlot(keySlot);
                if (viewCellSlot == null)
                {
                    return((ViewKeyConstraint)null);
                }
                viewCellSlotList.Add(viewCellSlot);
            }
            return(new ViewKeyConstraint(viewCellRelation, (IEnumerable <ViewCellSlot>)viewCellSlotList));
        }
Exemple #5
0
 internal void CreateBasicCellRelation(ViewCellRelation viewCellRelation)
 {
     var slots = GetAllQuerySlots();
     // Create a base cell relation that has all the scalar slots of this
     m_basicCellRelation = new BasicCellRelation(this, viewCellRelation, slots);
 }
Exemple #6
0
        private void GenerateCellRelations(int cellNumber)
        {
            // Generate the view cell relation
            var projectedSlots = new List<ViewCellSlot>();
            // construct a ViewCellSlot for each slot
            Debug.Assert(
                CQuery.NumProjectedSlots == SQuery.NumProjectedSlots,
                "Cell queries in cell have a different number of slots");
            for (var i = 0; i < CQuery.NumProjectedSlots; i++)
            {
                var cSlot = CQuery.ProjectedSlotAt(i);
                var sSlot = SQuery.ProjectedSlotAt(i);
                Debug.Assert(cSlot != null, "Has cell query been normalized?");
                Debug.Assert(sSlot != null, "Has cell query been normalized?");

                // These slots better be MemberProjectedSlots. We do not have constants etc at this point.
                Debug.Assert(cSlot is MemberProjectedSlot, "cSlot is expected to be MemberProjectedSlot");
                Debug.Assert(sSlot is MemberProjectedSlot, "sSlot is expected to be MemberProjectedSlot");

                var cJoinSlot = (MemberProjectedSlot)cSlot;
                var sJoinSlot = (MemberProjectedSlot)sSlot;

                var slot = new ViewCellSlot(i, cJoinSlot, sJoinSlot);
                projectedSlots.Add(slot);
            }
            m_viewCellRelation = new ViewCellRelation(this, projectedSlots, cellNumber);
        }