clang 19.0.0git
Public Types | Public Member Functions | Friends | List of all members
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 = std::iterator_traits< DeclContext::decl_iterator >::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 2428 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 = std::iterator_traits<DeclContext::decl_iterator>::difference_type

Definition at line 2450 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 2452 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 2449 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 2448 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 2445 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 2464 of file DeclBase.h.

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 2468 of file DeclBase.h.

◆ 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 2471 of file DeclBase.h.

◆ 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 2477 of file DeclBase.h.

◆ operator->()

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

Definition at line 2469 of file DeclBase.h.

Friends And Related Function Documentation

◆ 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 2488 of file DeclBase.h.

◆ 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 2483 of file DeclBase.h.


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