45 void set_field(
const google::protobuf::FieldDescriptor* field_desc)
47 field_desc_ = field_desc;
50 void set_descriptor(
const google::protobuf::Descriptor* msg_desc) { msg_desc_ = msg_desc; }
52 void set_repeated_index(
int index) { index_ = index; }
54 void regenerate(
const google::protobuf::Message* this_msg,
55 const google::protobuf::Message* root_msg,
int repeated_index = -1);
59 bool has_required_if() {
return conditions().has_required_if() || conditions().has_only_if(); }
60 bool has_omit_if() {
return conditions().has_omit_if() || conditions().has_only_if(); }
61 bool has_only_if() {
return conditions().has_only_if(); }
62 bool has_min() {
return conditions().has_min(); }
63 bool has_max() {
return conditions().has_max(); }
80 std::string return_prefix(
const std::string& script)
82 if (script.find(
"return") == std::string::npos)
83 return "return " + script;
88 bool is_initialized() {
return root_msg_ && this_msg_ && field_desc_; }
89 bool is_message_initialized() {
return root_msg_ && this_msg_ && msg_desc_; }
90 const google::protobuf::FieldDescriptor* field_desc_{
nullptr};
91 const google::protobuf::Descriptor* msg_desc_{
nullptr};
92 const google::protobuf::Message* this_msg_{
nullptr};
93 const google::protobuf::Message* root_msg_{
nullptr};
97 sol::state* lua_{
nullptr};