'Register this descriptor with the Proto Struct.'

@classmethod
def AddDescriptor(cls, field_desc):

    if (not isinstance(field_desc, ProtoType)):
        raise type_info.TypeValueError(("%s    field    '%s'    should    be    of    type    ProtoType" % (cls.__name__, field_desc.name)))
    field_desc.SetOwner(cls)
    if field_desc.late_bound:
        cls.late_bound_type_infos[field_desc.name] = field_desc
        return
    if (field_desc.field_number in cls.type_infos_by_field_number):
        raise type_info.TypeValueError(('Field    number    %s    for    field    %s    is    not    unique    in    %s' % (field_desc.field_number, field_desc.name, cls.__name__)))
    cls.type_infos_by_field_number[field_desc.field_number] = field_desc
    cls.type_infos_by_encoded_tag[field_desc.encoded_tag] = field_desc
    cls.type_infos.Append(field_desc)
    cls.late_bound_type_infos.pop(field_desc.name, None)
    if (not hasattr(cls, field_desc.name)):
        setattr(cls, field_desc.name, property((lambda self: self.Get(field_desc.name)), (lambda self, x: self._Set(x, field_desc)), None, field_desc.description))
