예제 #1
0
 public void SetUserTableSize(long tablesize)
 {
     if (tablesize <= 0)
     {
         throw new Exception("Invalid table size: " + tablesize.ToString());
     }
     table = new OneDInt32(tablesize / 4 + ((0 == (tablesize % 4)) ? 0 : 1));
 }
예제 #2
0
            internal static UserData Create(OneDInt32 table, long rowid)
            {
                UserData ud;

                ud.table = table;
                ud.rowid = rowid;
                return(ud);
            }
예제 #3
0
            public UserIDRange(int minID, int maxID)
            {
                this.minID       = minID;
                this.maxID       = maxID;
                usertotableindex = new OneDInt32(maxID - minID + 1);

                /* Now 0 (default) is treated as -1.
                 * for (int i = 0; i != usertotableindex.Length; i++)
                 * {
                 *  usertotableindex[i] = -1;
                 * }
                 * */
            }
예제 #4
0
 internal static bool DoesUserFit(OneDInt32 table, long rowid, IList <Int32> friends)
 {
     return(rowid + 1 + 1 + friends.Count <= table.LongLength);
 }