def _AddPrivateHelperMethods(message_descriptor, cls):
def Modified(self):<EOL><INDENT>"""<STR_LIT>"""<EOL>if not self._cached_byte_size_dirty:<EOL><INDENT>self._cached_byte_size_dirty = True<EOL>self._listener_for_children.dirty = True<EOL>self._is_present_in_parent = True<EOL>self._listener.Modified()<EOL><DEDENT><DEDENT>def _UpdateOneofState(self, field):<EOL><INDENT>"""<STR_LIT>"""<EOL>other_field = self._oneofs.setdefault(field.containing_oneof, field)<EOL>if other_field is not field:<EOL><INDENT>del self._fields[other_field]<EOL>self._oneofs[field.containing_oneof] = field<EOL><DEDENT><DEDENT>cls._Modified = Modified<EOL>cls.SetInParent = Modified<EOL>cls._UpdateOneofState = _UpdateOneofState<EOL>
Adds implementation of private helper methods to cls.