public int GetHashCode(RawConstantRow obj)
 {
     return((int)obj.Type +
            rol(obj.Padding, 3) +
            rol(obj.Parent, 7) +
            rol(obj.Value, 11));
 }
 public bool Equals(RawConstantRow x, RawConstantRow y)
 {
     return(x.Type == y.Type &&
            x.Padding == y.Padding &&
            x.Parent == y.Parent &&
            x.Value == y.Value);
 }
 void InitializeRawRow_NoLock()
 {
     if (rawRow != null)
     {
         return;
     }
     rawRow = readerModule.TablesStream.ReadConstantRow(rid);
 }
Exemple #4
0
        /// <summary>
        /// Reads a raw <c>Constant</c> row or returns false if the row doesn't exist
        /// </summary>
        /// <param name="rid">Row ID</param>
        /// <param name="row">Row data</param>
        /// <returns></returns>
        public bool TryReadConstantRow(uint rid, out RawConstantRow row)
        {
            var table = ConstantTable;

            if (table.IsInvalidRID(rid))
            {
                row = default;
                return(false);
            }
            var reader = table.DataReader;

            reader.Position = (rid - 1) * (uint)table.TableInfo.RowSize;
            row             = new RawConstantRow(
                reader.Unsafe_ReadByte(),
                reader.Unsafe_ReadByte(),
                table.Column2.Unsafe_Read24(ref reader),
                table.Column3.Unsafe_Read24(ref reader));
            return(true);
        }
Exemple #5
0
 static uint ReadConstantColumnMethod(ref RawConstantRow row, int index) => row[index];
 public int GetHashCode(RawConstantRow obj) =>
 obj.Type +
 rol(obj.Padding, 3) +
 rol(obj.Parent, 7) +
 rol(obj.Value, 11);