'Generate reST for member documentation.  If *all_members* is True,
do all members, else those given by *self.options.members*.'

def document_members(self, all_members=False):

    self.env.autodoc_current_module = self.modname
    if self.objpath:
        self.env.autodoc_current_class = self.objpath[0]
    want_all = (all_members or self.options.inherited_members or (self.options.members is ALL))
    (members_check_module, members) = self.get_object_members(want_all)
    if self.options.exclude_members:
        members = [(membername, member) for (membername, member) in members if (membername not in self.options.exclude_members)]
    memberdocumenters = []
    for (mname, member, isattr) in self.filter_members(members, want_all):
        classes = [cls for cls in AutoDirective._registry.itervalues() if cls.can_document_member(member, mname, isattr, self)]
        if (not classes):
            continue
        classes.sort(key=(lambda cls: cls.priority))
        full_mname = ((self.modname + '::') + '.'.join((self.objpath + [mname])))
        memberdocumenters.append(classes[(-1)](self.directive, full_mname, self.indent))
    if ((self.options.member_order or self.env.config.autodoc_member_order) == 'groupwise'):
        memberdocumenters.sort(key=(lambda d: d.member_order))
    for documenter in memberdocumenters:
        documenter.generate(all_members=True, real_modname=self.real_modname, check_module=members_check_module)
    self.env.autodoc_current_module = None
    self.env.autodoc_current_class = None
