/// <summary> /// Returns the value of the given field if the field has read its value before /// Makes the field read its value if it did not do so before /// </summary> /// <typeparam name="T"></typeparam> /// <param name="fieldName"></param> /// <returns></returns> protected T ReadFieldProxy <T>(string fieldName) where T : struct { CachedField <T> field = (CachedField <T>)Fields[fieldName]; if (!field.ValueRead) { field.ReadValue(this.Address, this.MemUtils); } return(field.Value); }
protected void AddField <T>(string fieldName, int offset, T value = default(T)) where T : struct { Fields[fieldName] = new CachedField <T>(offset, value); }