CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Classes | Macros | Typedefs
CppInterOpTypes.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for CppInterOpTypes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CppDeclRef
 Opaque handle types for the CppInterOp C and C++ API. More...
 
struct  CppTypeRef
 
struct  CppFuncRef
 
struct  CppObjectRef
 
struct  CppInterpRef
 
struct  CppConstDeclRef
 
struct  CppConstTypeRef
 
struct  CppConstFuncRef
 
struct  CppInterOpArray
 C-compatible array of opaque pointers, returned by generated C API wrappers for functions that produce collections. More...
 
struct  CppInterOpStringArray
 C-compatible array of strings, returned by generated C API wrappers for functions that produce string collections. More...
 
struct  TemplateArgInfo
 Holds information for instantiating a template. More...
 

Macros

#define CPPINTEROP_API
 
#define CPPINTEROP_DEPRECATED(msg)
 

Typedefs

typedef struct CppDeclRef CppDeclRef
 Opaque handle types for the CppInterOp C and C++ API.
 
typedef struct CppTypeRef CppTypeRef
 
typedef struct CppFuncRef CppFuncRef
 
typedef struct CppObjectRef CppObjectRef
 
typedef struct CppInterpRef CppInterpRef
 
typedef struct CppConstDeclRef CppConstDeclRef
 
typedef struct CppConstTypeRef CppConstTypeRef
 
typedef struct CppConstFuncRef CppConstFuncRef
 
typedef struct CppInterOpArray CppInterOpArray
 C-compatible array of opaque pointers, returned by generated C API wrappers for functions that produce collections.
 
typedef struct CppInterOpStringArray CppInterOpStringArray
 C-compatible array of strings, returned by generated C API wrappers for functions that produce string collections.
 
typedef struct TemplateArgInfo TemplateArgInfo
 Holds information for instantiating a template.
 

Macro Definition Documentation

◆ CPPINTEROP_API

#define CPPINTEROP_API

Definition at line 25 of file CppInterOpTypes.h.

◆ CPPINTEROP_DEPRECATED

#define CPPINTEROP_DEPRECATED (   msg)

Definition at line 37 of file CppInterOpTypes.h.

Typedef Documentation

◆ CppConstDeclRef

◆ CppConstFuncRef

◆ CppConstTypeRef

◆ CppDeclRef

typedef struct CppDeclRef CppDeclRef

Opaque handle types for the CppInterOp C and C++ API.

Each handle wraps a single void* and is a distinct type so the compiler rejects cross-kind misuse (e.g. passing a TypeRef where a DeclRef is expected). Layout is identical across all handles — a single pointer — so they are trivially copyable and ABI-stable.

The C and C++ views are declared independently:

  • C sees struct CppDeclRef { void* data; } etc. at global scope, prefixed so they don't collide with generic names from other C libraries.
  • C++ sees Cpp::DeclRef etc. in namespace Cpp, no prefix — the namespace already disambiguates. Both have identical layout, so a C-linkage function exchanging these structs across the boundary is byte-identical regardless of which view names it. The TableGen-emitted C-API .inc adds C++ typedef aliases (using CppDeclRef = Cpp::DeclRef;) so the generated C wrappers compile under C++ using the prefixed C-side names.

◆ CppFuncRef

typedef struct CppFuncRef CppFuncRef

◆ CppInterOpArray

C-compatible array of opaque pointers, returned by generated C API wrappers for functions that produce collections.

The caller must free the array by calling cppinterop_DisposeArray().

◆ CppInterOpStringArray

C-compatible array of strings, returned by generated C API wrappers for functions that produce string collections.

Each string is individually allocated with strdup(). The caller must free the array by calling cppinterop_DisposeStringArray().

◆ CppInterpRef

typedef struct CppInterpRef CppInterpRef

◆ CppObjectRef

typedef struct CppObjectRef CppObjectRef

◆ CppTypeRef

typedef struct CppTypeRef CppTypeRef

◆ TemplateArgInfo

Holds information for instantiating a template.

Standard-layout, C-compatible.