nndeploy C++ API  0.2.0
nndeploy C++ API
Classes | Namespaces | Macros | Functions
dlopen.h File Reference
#include "nndeploy/base/common.h"
#include "nndeploy/base/glic_stl_include.h"
#include "nndeploy/base/log.h"
#include "nndeploy/base/macro.h"
#include "nndeploy/base/object.h"
#include "nndeploy/base/opencv_include.h"
#include "nndeploy/base/param.h"
#include "nndeploy/base/status.h"
#include "nndeploy/base/string.h"
#include <dlfcn.h>
Include dependency graph for dlopen.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  nndeploy::base::Handle
 

Namespaces

 nndeploy
 
 nndeploy::base
 

Macros

#define NNDEPLOY_DEFINE_FUNC_PTR(func)   func##Func func = nullptr
 
#define NNDEPLOY_LOAD_FUNCTION_PTR(handle, func_name)
 
#define NNDEPLOY_TRY_LOAD_FUNCTION_PTR(handle, func_name)
 

Functions

bool nndeploy::base::freeLibrary (const std::string &path)
 
Handle * nndeploy::base::getLibraryHandle (const std::string &path, bool update)
 
bool nndeploy::base::loadLibraryFromPath (const std::string &path, bool update)
 

Macro Definition Documentation

◆ NNDEPLOY_DEFINE_FUNC_PTR

#define NNDEPLOY_DEFINE_FUNC_PTR (   func)    func##Func func = nullptr

Definition at line 26 of file dlopen.h.

◆ NNDEPLOY_LOAD_FUNCTION_PTR

#define NNDEPLOY_LOAD_FUNCTION_PTR (   handle,
  func_name 
)
Value:
if (is_pixel) { \
func_name = \
reinterpret_cast<func_name##Func>(loadOpenCLPointer(#func_name)); \
} else { \
func_name = reinterpret_cast<func_name##Func>(dlsym(handle, #func_name)); \
} \
if (func_name == nullptr) { \
NNDEPLOY_LOGE("load func (%s) from (%s) failed!\n", #func_name, \
library_path.c_str()); \
return false; \
}

Definition at line 49 of file dlopen.h.

◆ NNDEPLOY_TRY_LOAD_FUNCTION_PTR

#define NNDEPLOY_TRY_LOAD_FUNCTION_PTR (   handle,
  func_name 
)
Value:
if (is_pixel) { \
func_name = \
reinterpret_cast<func_name##Func>(loadOpenCLPointer(#func_name)); \
} else { \
func_name = reinterpret_cast<func_name##Func>(dlsym(handle, #func_name)); \
} \
if (func_name == nullptr) { \
NNDEPLOY_LOGE("load func (%s) from (%s) failed!\n", #func_name, \
library_path.c_str()); \
}

Definition at line 64 of file dlopen.h.