Ejemplo n.º 1
0
 public override void Put(StreamBase f)
 {
     base.Put(f);
     source.Put(f);
     f.PutInt(groupby.Length);
     for (var b = groupby.First(); b != null; b = b.Next())
     {
         f.PutString(b.Value.Item2);
     }
     f.PutInt(having.Length);
     for (var b = having.First(); b != null; b = b.Next())
     {
         b.Value.Put(f);
     }
 }
Ejemplo n.º 2
0
 public virtual SIndex?GetPrimaryIndex(long t)
 {
     for (var b = objects.First(); b != null; b = b.Next())
     {
         if (b.Value.Item2 is SIndex x && x.table == t)
         {
             return(x);
         }
     }
     return(null);
 }
Ejemplo n.º 3
0
        public SQuery(Types t, SDict <int, string> a, SDict <int, Serialisable> c,
                      Context cx) : base(t)
        {
            var cp = SDict <int, Serialisable> .Empty;
            var cn = SDict <string, Serialisable> .Empty;
            var ab = a.First();

            for (var cb = c.First(); ab != null && cb != null; ab = ab.Next(), cb = cb.Next())
            {
                var s = cb.Value.Item2.Lookup(cx);
                cp += (cb.Value.Item1, s);
                cn += (ab.Value.Item2, s);
            }
            display = a;
            cpos    = cp;
            names   = cn;
        }
Ejemplo n.º 4
0
        public SDict <K, V> Merge(SDict <K, V> ud)
        {
            var r  = Empty;
            var ob = First();
            var ub = ud.First();

            while (ob != null && ub != null)
            {
                var c = ob.Value.Item1.CompareTo(ub.Value.Item1);
                if (c == 0)
                {
                    r += (ub.Value.Item1, ub.Value.Item2);
                    ob = ob.Next();
                    ub = ub.Next();
                }
                else if (c < 0)
                {
                    r += ob.Value;
                    ob = ob.Next();
                }
                else
                {
                    r += ub.Value;
                    ub = ub.Next();
                }
            }
            for (; ob != null; ob = ob.Next())
            {
                r += ob.Value;
            }
            for (; ub != null; ub = ub.Next())
            {
                r += ub.Value;
            }
            return(r);
        }