CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Namespaces | Macros | Typedefs | Functions
Dispatch.h File Reference
#include <dlfcn.h>
#include "CppInterOp/Box.h"
#include "CppInterOp/CppInterOpTypes.h"
#include <cstdlib>
#include <iostream>
#include <memory>
#include <mutex>
#include <set>
#include "CppInterOp/CppInterOpAPI.inc"
Include dependency graph for Dispatch.h:

Go to the source code of this file.

Namespaces

namespace  CppInternal
 
namespace  CppInternal::DispatchRaw
 
namespace  Cpp
 

Macros

#define CPPINTEROP_API_FUNC(DN, CN, Ret, DeclArgs, CallArgs, RawTypes)    extern Ret(*DN) RawTypes;
 
#define CPPINTEROP_API_FUNC(DN, CN, Ret, DeclArgs, CallArgs, RawTypes)    inline Ret CN DeclArgs { return ::CppInternal::DispatchRaw::DN CallArgs; }
 
#define CPPINTEROP_API_FUNC(DN, CN, Ret, DeclArgs, CallArgs, RawTypes)
 
#define CPPINTEROP_API_FUNC(DN, CN, Ret, DeclArgs, CallArgs, RawTypes)    ::CppInternal::DispatchRaw::DN = nullptr;
 

Typedefs

using CppFnPtrTy = void(*)()
 

Functions

CppFnPtrTy CppGetProcAddress (const char *procname)
 
void * dlGetProcAddress (const char *name, const char *customLibPath=nullptr)
 
bool Cpp::LoadDispatchAPI (const char *customLibPath=nullptr)
 Initialize all CppInterOp API from the dynamically loaded library.
 
void Cpp::UnloadDispatchAPI ()
 

Macro Definition Documentation

◆ CPPINTEROP_API_FUNC [1/4]

#define CPPINTEROP_API_FUNC (   DN,
  CN,
  Ret,
  DeclArgs,
  CallArgs,
  RawTypes 
)     extern Ret(*DN) RawTypes;

Definition at line 109 of file Dispatch.h.

◆ CPPINTEROP_API_FUNC [2/4]

#define CPPINTEROP_API_FUNC (   DN,
  CN,
  Ret,
  DeclArgs,
  CallArgs,
  RawTypes 
)     inline Ret CN DeclArgs { return ::CppInternal::DispatchRaw::DN CallArgs; }

Definition at line 109 of file Dispatch.h.

◆ CPPINTEROP_API_FUNC [3/4]

#define CPPINTEROP_API_FUNC (   DN,
  CN,
  Ret,
  DeclArgs,
  CallArgs,
  RawTypes 
)
Value:
::CppInternal::DispatchRaw::DN = \
reinterpret_cast<Ret(*) RawTypes>(dlGetProcAddress(#DN));
void * dlGetProcAddress(const char *name, const char *customLibPath=nullptr)
Definition Dispatch.h:52

Definition at line 109 of file Dispatch.h.

◆ CPPINTEROP_API_FUNC [4/4]

#define CPPINTEROP_API_FUNC (   DN,
  CN,
  Ret,
  DeclArgs,
  CallArgs,
  RawTypes 
)     ::CppInternal::DispatchRaw::DN = nullptr;

Definition at line 109 of file Dispatch.h.

Typedef Documentation

◆ CppFnPtrTy

using CppFnPtrTy = void (*)()

Definition at line 44 of file Dispatch.h.

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.

◆ dlGetProcAddress()

void * dlGetProcAddress ( const char *  name,
const char *  customLibPath = nullptr 
)
inline

Definition at line 52 of file Dispatch.h.

Referenced by Cpp::LoadDispatchAPI(), and Cpp::UnloadDispatchAPI().