Skip to content

Instantly share code, notes, and snippets.

@peschkaj
Last active December 24, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peschkaj/6860936 to your computer and use it in GitHub Desktop.
Save peschkaj/6860936 to your computer and use it in GitHub Desktop.

generated.cs is produced by Protobuf-net - you'll notice line 5's hilarious half-complete enumeration. This happens because CLR enums are value types and can't technically be null.

Corrected.cs contains my corrections on line 5. I think that this should let us get around these problems - it's good to know, though, because these do occur in a few other places in the protocol buffers interface.

private MapUpdate.FlagOp? _flag_op;
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"flag_op", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public MapUpdate.FlagOp flag_op
{
get { return _flag_op.Value; }
set { _flag_op = value; }
}
[global::System.Xml.Serialization.XmlIgnore]
[global::System.ComponentModel.Browsable(false)]
public bool flag_opSpecified
{
get { return _flag_op != null; }
set { if (value == (_flag_op== null)) _flag_op = value ? flag_op : (MapUpdate.FlagOp?)null; }
}
private bool ShouldSerializeflag_op() { return flag_opSpecified; }
private void Resetflag_op() { flag_opSpecified = false; }
private MapUpdate.FlagOp? _flag_op;
[global::ProtoBuf.ProtoMember(5, IsRequired = false, Name=@"flag_op", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
public MapUpdate.FlagOp flag_op
{
get { return _flag_op?? MapUpdate.FlagOp.; }
set { _flag_op = value; }
}
[global::System.Xml.Serialization.XmlIgnore]
[global::System.ComponentModel.Browsable(false)]
public bool flag_opSpecified
{
get { return _flag_op != null; }
set { if (value == (_flag_op== null)) _flag_op = value ? flag_op : (MapUpdate.FlagOp?)null; }
}
private bool ShouldSerializeflag_op() { return flag_opSpecified; }
private void Resetflag_op() { flag_opSpecified = false; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment