Example #1
0
 public virtual Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForIntSequence(
     Transaction trans, int length, IEnumerator iterator)
 {
     Db4objects.Db4o.CS.Internal.Messages.MsgD message = GetWriterForLength(trans, Const4
                                                                            .IntLength * (length + 1));
     message.WriteInt(length);
     while (iterator.MoveNext())
     {
         message.WriteInt(((int)iterator.Current));
     }
     return(message);
 }
Example #2
0
 public Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForInt(Transaction a_trans
                                                                  , int id)
 {
     Db4objects.Db4o.CS.Internal.Messages.MsgD message = GetWriterForLength(a_trans, Const4
                                                                            .IntLength);
     message.WriteInt(id);
     return(message);
 }
Example #3
0
 public Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForIntString(Transaction
                                                                        a_trans, int anInt, string str)
 {
     Db4objects.Db4o.CS.Internal.Messages.MsgD message = GetWriterForLength(a_trans, Const4
                                                                            .stringIO.Length(str) + Const4.IntLength * 2);
     message.WriteInt(anInt);
     message.WriteString(str);
     return(message);
 }
Example #4
0
 public Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForLength(Transaction trans
                                                                     , int length)
 {
     Db4objects.Db4o.CS.Internal.Messages.MsgD message = (Db4objects.Db4o.CS.Internal.Messages.MsgD
                                                          )PublicClone();
     message.SetTransaction(trans);
     message._payLoad = new StatefulBuffer(trans, length + Const4.MessageLength);
     message.WriteInt(_msgID);
     message.WriteInt(length);
     if (trans.ParentTransaction() == null)
     {
         message._payLoad.WriteByte(Const4.SystemTrans);
     }
     else
     {
         message._payLoad.WriteByte(Const4.UserTrans);
     }
     return(message);
 }
Example #5
0
 public Db4objects.Db4o.CS.Internal.Messages.MsgD GetWriterForInts(Transaction trans
                                                                   , int[] ints)
 {
     Db4objects.Db4o.CS.Internal.Messages.MsgD message = GetWriterForLength(trans, Const4
                                                                            .IntLength * ints.Length);
     for (int i = 0; i < ints.Length; i++)
     {
         message.WriteInt(ints[i]);
     }
     return(message);
 }
Example #6
0
        public Msg ReplyFromServer()
        {
            int  prefetchIDCount = ReadInt();
            MsgD reply           = Msg.IdList.GetWriterForLength(Transaction(), Const4.IntLength * prefetchIDCount
                                                                 );

            lock (ContainerLock())
            {
                ITransactionalIdSystem idSystem = Transaction().IdSystem();
                for (int i = 0; i < prefetchIDCount; i++)
                {
                    reply.WriteInt(idSystem.PrefetchID());
                }
            }
            return(reply);
        }