44 const google::protobuf::Descriptor* top_descriptor()
const
46 return !desc.empty() ? desc.back() :
nullptr;
48 const google::protobuf::Message* top_message()
const
50 return !messages.empty() ? messages.back().msg :
nullptr;
52 const google::protobuf::FieldDescriptor* top_field()
const
54 return !field.empty() ? field.back() :
nullptr;
56 MessagePart current_part()
const {
return parts.empty() ? UNKNOWN : parts.back(); }
58 std::vector<const google::protobuf::Descriptor*> desc;
59 std::vector<const google::protobuf::FieldDescriptor*> field;
60 std::vector<MessagePart> parts;
64 const google::protobuf::Message* msg;
66 const google::protobuf::FieldDescriptor* field{
nullptr};
68 std::vector<MessageAndField> messages;
82 const google::protobuf::FieldDescriptor* field =
nullptr);
86 bool first()
const {
return data_.desc.empty(); }
87 int count()
const {
return data_.desc.size(); }
89 void push(
const google::protobuf::Descriptor* desc);
90 void push(
const google::protobuf::FieldDescriptor* field);
91 void push(MessagePart part);
93 void update_index(
const google::protobuf::Message* root_message,
94 const google::protobuf::FieldDescriptor* field,
int index);
95 void push_message(
const google::protobuf::Message* root_message,
96 const google::protobuf::FieldDescriptor* field,
int index = -1);
98 std::size_t field_size()
const {
return data_.field.size(); }
99 MessagePart current_part()
const {
return data_.current_part(); }
105 void __pop_messages();
109 int descriptors_pushed_;
112 int messages_pushed_;