22 #ifndef DCCLFIELDCODECHELPERS20110825H
23 #define DCCLFIELDCODECHELPERS20110825H
25 #include "dccl/common.h"
30 enum MessagePart { HEAD, BODY, UNKNOWN };
39 MessageStack(
const google::protobuf::FieldDescriptor* field = 0);
44 {
return desc_.empty(); }
46 {
return desc_.size(); }
48 void push(
const google::protobuf::Descriptor* desc);
49 void push(
const google::protobuf::FieldDescriptor* field);
50 void push(MessagePart part);
52 static MessagePart current_part() {
return parts_.empty() ? UNKNOWN : parts_.back(); }
54 friend class ::dccl::FieldCodecBase;
60 static std::vector<const google::protobuf::Descriptor*> desc_;
61 static std::vector<const google::protobuf::FieldDescriptor*> field_;
62 static std::vector<MessagePart> parts_;
63 int descriptors_pushed_;