clang 23.0.0git
clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable > Class Template Reference

Iterates over a filtered subrange of declarations stored in a DeclContext. More...

#include "clang/AST/DeclBase.h"

Public Types

using value_type = SpecificDecl *
using reference = void
using pointer = void
using difference_type
using iterator_category = std::forward_iterator_tag

Public Member Functions

 filtered_decl_iterator ()=default
 filtered_decl_iterator (DeclContext::decl_iterator C)
 filtered_decl_iterator - Construct a new iterator over a subset of the declarations the range [C, end-of-declarations).
value_type operator* () const
value_type operator-> () const
filtered_decl_iteratoroperator++ ()
filtered_decl_iterator operator++ (int)

Friends

bool operator== (const filtered_decl_iterator &x, const filtered_decl_iterator &y)
bool operator!= (const filtered_decl_iterator &x, const filtered_decl_iterator &y)

Detailed Description

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
class clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >

Iterates over a filtered subrange of declarations stored in a DeclContext.

This iterator visits only those declarations that are of type SpecificDecl (or a class derived from it) and that meet some additional run-time criteria. This iterator is used, for example, to provide access to the instance methods within an Objective-C interface (with SpecificDecl = ObjCMethodDecl and Acceptable = ObjCMethodDecl::isInstanceMethod).

Definition at line 2482 of file DeclBase.h.

Member Typedef Documentation

◆ difference_type

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
using clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::difference_type
Initial value:
std::iterator_traits<DeclContext::decl_iterator>::difference_type

Definition at line 2504 of file DeclBase.h.

◆ iterator_category

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
using clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::iterator_category = std::forward_iterator_tag

Definition at line 2506 of file DeclBase.h.

◆ pointer

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
using clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::pointer = void

Definition at line 2503 of file DeclBase.h.

◆ reference

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
using clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::reference = void

Definition at line 2502 of file DeclBase.h.

◆ value_type

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
using clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::value_type = SpecificDecl *

Definition at line 2499 of file DeclBase.h.

Constructor & Destructor Documentation

◆ filtered_decl_iterator() [1/2]

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::filtered_decl_iterator ( )
default

◆ filtered_decl_iterator() [2/2]

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::filtered_decl_iterator ( DeclContext::decl_iterator C)
inlineexplicit

filtered_decl_iterator - Construct a new iterator over a subset of the declarations the range [C, end-of-declarations).

If A is non-NULL, it is a pointer to a member function of SpecificDecl that should return true for all of the SpecificDecl instances that will be in the subset of iterators. For example, if you want Objective-C instance methods, SpecificDecl will be ObjCMethodDecl and A will be &ObjCMethodDecl::isInstanceMethod.

Definition at line 2518 of file DeclBase.h.

References clang::C.

Member Function Documentation

◆ operator*()

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
value_type clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::operator* ( ) const
inline

Definition at line 2522 of file DeclBase.h.

References clang::cast().

◆ operator++() [1/2]

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
filtered_decl_iterator & clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::operator++ ( )
inline

Definition at line 2525 of file DeclBase.h.

References filtered_decl_iterator().

◆ operator++() [2/2]

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
filtered_decl_iterator clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::operator++ ( int )
inline

Definition at line 2531 of file DeclBase.h.

References filtered_decl_iterator().

◆ operator->()

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
value_type clang::DeclContext::filtered_decl_iterator< SpecificDecl, Acceptable >::operator-> ( ) const
inline

Definition at line 2523 of file DeclBase.h.

References clang::cast().

◆ operator!=

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
bool operator!= ( const filtered_decl_iterator< SpecificDecl, Acceptable > & x,
const filtered_decl_iterator< SpecificDecl, Acceptable > & y )
friend

Definition at line 2542 of file DeclBase.h.

References filtered_decl_iterator().

◆ operator==

template<typename SpecificDecl, bool(SpecificDecl::*)() const Acceptable>
bool operator== ( const filtered_decl_iterator< SpecificDecl, Acceptable > & x,
const filtered_decl_iterator< SpecificDecl, Acceptable > & y )
friend

Definition at line 2537 of file DeclBase.h.

References filtered_decl_iterator().


The documentation for this class was generated from the following file: