clang  6.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
clang::OpaquePtr< PtrTy > Class Template Reference

Wrapper for void* pointer. More...

#include "clang/Sema/Ownership.h"

Inheritance diagram for clang::OpaquePtr< PtrTy >:
Inheritance graph
[legend]

Public Member Functions

 OpaquePtr (std::nullptr_t=nullptr)
 
template<typename PointeeT >
PointeeT * getPtrTo () const
 Returns plain pointer to the entity pointed by this wrapper. More...
 
template<typename PtrT >
PtrT getPtrAs () const
 Returns pointer converted to the specified type. More...
 
PtrTy get () const
 
void set (PtrTy P)
 
 operator bool () const
 
void * getAsOpaquePtr () const
 

Static Public Member Functions

static OpaquePtr make (PtrTy P)
 
static OpaquePtr getFromOpaquePtr (void *P)
 

Detailed Description

template<class PtrTy>
class clang::OpaquePtr< PtrTy >

Wrapper for void* pointer.

Template Parameters
PtrTyEither a pointer type like 'T*' or a type that behaves like a pointer.

This is a very simple POD type that wraps a pointer that the Parser doesn't know about but that Sema or another client does. The PtrTy template argument is used to make sure that "Decl" pointers are not compatible with "Type" pointers for example.

Definition at line 45 of file Ownership.h.

Constructor & Destructor Documentation

◆ OpaquePtr()

template<class PtrTy>
clang::OpaquePtr< PtrTy >::OpaquePtr ( std::nullptr_t  = nullptr)
inline

Definition at line 52 of file Ownership.h.

Member Function Documentation

◆ get()

template<class PtrTy>
PtrTy clang::OpaquePtr< PtrTy >::get ( ) const
inline

◆ getAsOpaquePtr()

template<class PtrTy>
void* clang::OpaquePtr< PtrTy >::getAsOpaquePtr ( ) const
inline

◆ getFromOpaquePtr()

template<class PtrTy>
static OpaquePtr clang::OpaquePtr< PtrTy >::getFromOpaquePtr ( void *  P)
inlinestatic

◆ getPtrAs()

template<class PtrTy>
template<typename PtrT >
PtrT clang::OpaquePtr< PtrTy >::getPtrAs ( ) const
inline

Returns pointer converted to the specified type.

Template Parameters
PtrTResult pointer type. There must be implicit conversion from PtrTy to PtrT.

In contrast to getPtrTo, this method allows the return type to be a smart pointer.

Definition at line 70 of file Ownership.h.

◆ getPtrTo()

template<class PtrTy>
template<typename PointeeT >
PointeeT* clang::OpaquePtr< PtrTy >::getPtrTo ( ) const
inline

Returns plain pointer to the entity pointed by this wrapper.

Template Parameters
PointeeTType of pointed entity.

It is identical to getPtrAs<PointeeT*>.

Definition at line 60 of file Ownership.h.

◆ make()

template<class PtrTy>
static OpaquePtr clang::OpaquePtr< PtrTy >::make ( PtrTy  P)
inlinestatic

Definition at line 54 of file Ownership.h.

◆ operator bool()

template<class PtrTy>
clang::OpaquePtr< PtrTy >::operator bool ( ) const
inlineexplicit

Definition at line 82 of file Ownership.h.

◆ set()

template<class PtrTy>
void clang::OpaquePtr< PtrTy >::set ( PtrTy  P)
inline

Definition at line 78 of file Ownership.h.

Referenced by clang::OpaquePtr< TemplateName >::make().


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