Protogen from protobuf-ner r614 generates code that does not compile. The
.proto file seems to be fine as protogen does not report any errors and
same .proto file is used to generate c++ code that compiles fine. Here is
part that causes the problem:
message CosDgp
{
enum Type
{
Offline = 1;
Online = 2;
//... skipped
}
enum RestartReason
{
ResetPin = 1;
PowerCycle = 2;
//...skipped
}
enum ActiveTask
{
HeartBeat = 1;
Task0 = 2;
//... skipped
}
//Cos type
required Type type = 1;
//Panel number
required int32 panel = 2;
//Dgp number
required int32 dgp = 3;
//User number (used for types Isolated, Deisolated, DePolled and Polled)
optional int32 user = 5;
//Restart reason (used for type CpuRestart)
optional RestartReason restart_reason = 6;
//Active task at reset (used for type CpuRestart)
optional ActiveTask active_task = 7;
//Checkpoint (used for type CpuRestart)
optional int32 checkpoint = 8;
//Time and date
required int32 time = 9;
}
And the generated code with the errors:
[global::System.Serializable,
global::ProtoBuf.ProtoContract(Name=@"CosDgp")]
public partial class CosDgp : global::ProtoBuf.IExtensible
{
...
private CosDgp.RestartReason _restart_reason = CosDgp.RestartReason.;
<<<<<<<<<<<<<<<<<<< error on this line
[global::ProtoBuf.ProtoMember(6, IsRequired = false,
Name=@"restart_reason", DataFormat =
global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(CosDgp.RestartReason.)]
<<<<<<<<<<<<<<<<<<<
error on this line
public CosDgp.RestartReason restart_reason
{
get { return _restart_reason; }
set { _restart_reason = value; }
}
private CosDgp.ActiveTask _active_task =
CosDgp.ActiveTask.; <<<<<<<<<<<<<<<<<<< error on this line
[global::ProtoBuf.ProtoMember(7, IsRequired = false,
Name=@"active_task", DataFormat =
global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue(CosDgp.ActiveTask.)]
<<<<<<<<<<<<<<<<<<<
error on this line
public CosDgp.ActiveTask active_task
{
get { return _active_task; }
set { _active_task = value; }
}
...
Please avise.
Regards,
Paul
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/protobuf/-/VWfPUfjIeqIJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.