CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
CppInterOpDispatch.cpp File Reference
#include "CppInterOp/CppInterOp.h"
#include <iostream>
#include <string_view>
#include <unordered_map>
#include "CppInterOp/CppInterOpAPI.inc"
Include dependency graph for CppInterOpDispatch.cpp:

Go to the source code of this file.

Macros

#define CPPINTEROP_API_FUNC(DN, CN, Ret, DeclArgs, CallArgs, RawTypes)    {#DN, (CppFnPtrTy) static_cast<Ret(*) RawTypes>(&Cpp::CN)},
 

Typedefs

using CppFnPtrTy = void(*)()
 

Functions

CppFnPtrTy CppGetProcAddress (const char *funcName)
 

Variables

static const std::unordered_map< std::string_view, CppFnPtrTyDispatchMap
 

Macro Definition Documentation

◆ CPPINTEROP_API_FUNC

#define CPPINTEROP_API_FUNC (   DN,
  CN,
  Ret,
  DeclArgs,
  CallArgs,
  RawTypes 
)     {#DN, (CppFnPtrTy) static_cast<Ret(*) RawTypes>(&Cpp::CN)},

Typedef Documentation

◆ CppFnPtrTy

using CppFnPtrTy = void (*)()

Definition at line 13 of file CppInterOpDispatch.cpp.

Function Documentation

◆ CppGetProcAddress()

CppFnPtrTy CppGetProcAddress ( const char *  procname)
Parameters
[in]procname- the name of the FunctionEntry in the symbol lookup table.
Returns
the function address of the requested API, or nullptr if not found

Definition at line 37 of file CppInterOpDispatch.cpp.

References DispatchMap.

Variable Documentation

◆ DispatchMap

const std::unordered_map<std::string_view, CppFnPtrTy> DispatchMap
static
Initial value:
= {
#define CPPINTEROP_API_FUNC(DN, CN, Ret, DeclArgs, CallArgs, RawTypes)
}

Definition at line 25 of file CppInterOpDispatch.cpp.

Referenced by CppGetProcAddress().