public override void FillBox(Box box, object o, Mapper mapper) { // we store the id of the type message in an uint var valueBox = new ScalarValueBox(); valueBox.ULong = mapper.GetTypeMetadataId((Type)o, null); // don't change the transformer that is used for objects / boxes of this type! box.Value = valueBox; }
protected override void Populate(Box box, bool value, Mapper mapper) { var b = new ScalarValueBox(); b.ULong = Convert.ToUInt64(value); box.Value = b; }
protected override void Populate(Box box, string value, Mapper mapper) { var b = new ScalarValueBox(); b.ULong = mapper.GetStringId(value); box.Value = b; }
protected override void Populate(Box box, TimeSpan value, Mapper mapper) { var b = new ScalarValueBox(); b.Long = value.Ticks; box.Value = b; }
protected override void Populate(Box box, char value, Mapper mapper) { var b = new ScalarValueBox(); b.ULong = value; box.Value = b; }
protected override void Populate(Box box, double value, Mapper mapper) { var b = new ScalarValueBox(); b.Double = value; box.Value = b; }
protected override void Populate(Box box, float value, Mapper mapper) { var b = new ScalarValueBox(); b.Float = value; box.Value = b; }
protected override void Populate(Box box, Guid value, Mapper mapper) { var b = new ScalarValueBox(); b.Bytes = ByteString.CopyFrom(value.ToByteArray()); box.Value = b; }