给定一条看起来像这样的消息,
message Event {
required int32 event_id = 1;
oneof EventType {
FooEvent foo_event = 2;
BarEvent bar_event = 3;
BazEvent baz_event = 4;
}
}
我想定义另一个使用 EventType oneof 作为类型的地图。准确地说,我想定义这样的东西
message Sample {
map<string, Event.EventTypeCase> someMap = 1;
}
但是,这是行不通的。我得到的错误是
PROTOC FAILED: "Event.EventTypeCase" is not defined.