class OpaquePtr

Declaration

template <class PtrTy>
class OpaquePtr { /* full declaration omitted */ };

Description

Wrapper for void* 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.

Declared at: clang/include/clang/Sema/Ownership.h:50

Templates

PtrTy
Either a pointer type like 'T*' or a type that behaves like a pointer.

Member Variables

private void* Ptr = nullptr

Method Overview

Methods

OpaquePtr<PtrTy>(void* Ptr)

Declared at: clang/include/clang/Sema/Ownership.h:53

Parameters

void* Ptr

OpaquePtr<PtrTy>(std::nullptr_t = nullptr)

Declared at: clang/include/clang/Sema/Ownership.h:58

Parameters

std::nullptr_t = nullptr

PtrTy get() const

Declared at: clang/include/clang/Sema/Ownership.h:80

void* getAsOpaquePtr() const

Declared at: clang/include/clang/Sema/Ownership.h:90

static OpaquePtr<PtrTy> getFromOpaquePtr(void* P)

Declared at: clang/include/clang/Sema/Ownership.h:91

Parameters

void* P

template <typename PtrT>
PtrT getPtrAs() const

Description

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

Declared at: clang/include/clang/Sema/Ownership.h:76

Templates

PtrT
Result pointer type. There must be implicit conversion from PtrTy to PtrT.

template <typename PointeeT>
PointeeT* getPtrTo() const

Description

Returns plain pointer to the entity pointed by this wrapper. It is identical to getPtrAs <PointeeT *>.

Declared at: clang/include/clang/Sema/Ownership.h:66

Templates

PointeeT
Type of pointed entity.

static OpaquePtr<PtrTy> make(PtrTy P)

Declared at: clang/include/clang/Sema/Ownership.h:60

Parameters

PtrTy P

bool operator bool() const

Declared at: clang/include/clang/Sema/Ownership.h:88

void set(PtrTy P)

Declared at: clang/include/clang/Sema/Ownership.h:84

Parameters

PtrTy P