clang 19.0.0git
Public Member Functions | Protected Attributes | List of all members
clang::CanProxyBase< T > Class Template Reference

Base class of all canonical proxy types, which is responsible for storing the underlying canonical type and providing basic conversions. More...

#include "clang/AST/CanonicalType.h"

Inheritance diagram for clang::CanProxyBase< T >:
Inheritance graph
[legend]

Public Member Functions

const T * getTypePtr () const
 Retrieve the pointer to the underlying Type.
 
 operator const T * () const
 Implicit conversion to the underlying pointer.
 
template<typename U >
CanProxy< UgetAs () const
 Try to convert the given canonical type to a specific structural type.
 
const CanProxyAdaptor< T > * operator-> () const
 Retrieve the proxy-adaptor type.
 

Protected Attributes

CanQual< T > Stored
 

Detailed Description

template<typename T>
class clang::CanProxyBase< T >

Base class of all canonical proxy types, which is responsible for storing the underlying canonical type and providing basic conversions.

Definition at line 239 of file CanonicalType.h.

Member Function Documentation

◆ getAs()

template<typename T >
template<typename U >
CanProxy< U > clang::CanProxyBase< T >::getAs ( ) const
inline

Try to convert the given canonical type to a specific structural type.

Definition at line 258 of file CanonicalType.h.

◆ getTypePtr()

template<typename T >
const T * clang::CanProxyBase< T >::getTypePtr ( ) const
inline

◆ operator const T *()

template<typename T >
clang::CanProxyBase< T >::operator const T * ( ) const
inline

Implicit conversion to the underlying pointer.

Also provides the ability to use canonical type proxies in a Boolean

if (CanQual<PointerType> Ptr = T->getAs<PointerType>()) { ... }
Represents a canonical, potentially-qualified type.
Definition: CanonicalType.h:65
CanProxy< U > getAs() const
Retrieve a canonical type pointer with a different static type, upcasting or downcasting as needed.
PointerType - C99 6.7.5.1 - Pointer Declarators.
Definition: Type.h:2898

Definition at line 254 of file CanonicalType.h.

◆ operator->()

template<typename T >
const CanProxyAdaptor< T > * clang::CanProxyBase< T >::operator-> ( ) const
inline

Retrieve the proxy-adaptor type.

This arrow operator is used when CanProxyAdaptor has been specialized for the given type T. In that case, we reference members of the CanProxyAdaptor specialization. Otherwise, this operator will be hidden by the arrow operator in the primary CanProxyAdaptor template.

Definition at line 322 of file CanonicalType.h.

Member Data Documentation

◆ Stored

template<typename T >
CanQual<T> clang::CanProxyBase< T >::Stored
protected

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