24 #ifndef DCCLFIELDCODECHELPERS20110825H
25 #define DCCLFIELDCODECHELPERS20110825H
27 #include "../common.h"
44 const google::protobuf::Descriptor* top_descriptor()
const
46 return !desc.empty() ? desc.back() :
nullptr;
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;
66 const google::protobuf::FieldDescriptor* field{
nullptr};
68 std::vector<MessageAndField> messages;
76 const google::protobuf::FieldDescriptor* field =
nullptr);
80 bool first()
const {
return data_.desc.empty(); }
81 int count()
const {
return data_.desc.size(); }
83 void push(
const google::protobuf::Descriptor* desc);
84 void push(
const google::protobuf::FieldDescriptor* field);
85 void push(MessagePart part);
88 const google::protobuf::FieldDescriptor* field,
int index);
90 const google::protobuf::FieldDescriptor* field,
int index = -1);
92 std::size_t field_size()
const {
return data_.field.size(); }
93 MessagePart current_part()
const {
return data_.current_part(); }
99 void __pop_messages();
103 int descriptors_pushed_;
106 int messages_pushed_;