Download modules/core/src/utils/plugin_loader.impl.hpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 1.81 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/utils/plugin_loader.impl.hpp
- Command line
-
hf download hf://tgollogly/test/modules/core/src/utils/plugin_loader.impl.hpp
-
curl -L -o plugin_loader.impl.hpp https://huggingface.co/tgollogly/test/resolve/main/modules/core/src/utils/plugin_loader.impl.hpp
1.81 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| // | |
| // Not a standalone header, part of filesystem.cpp | |
| // | |
| namespace cv { namespace plugin { namespace impl { | |
| DynamicLib::DynamicLib(const FileSystemPath_t& filename) | |
| : handle(0), fname(filename), disableAutoUnloading_(false) | |
| { | |
| libraryLoad(filename); | |
| } | |
| DynamicLib::~DynamicLib() | |
| { | |
| if (!disableAutoUnloading_) | |
| { | |
| libraryRelease(); | |
| } | |
| else if (handle) | |
| { | |
| CV_LOG_INFO(NULL, "skip auto unloading (disabled): " << toPrintablePath(fname)); | |
| handle = 0; | |
| } | |
| } | |
| void* DynamicLib::getSymbol(const char* symbolName) const | |
| { | |
| if (!handle) | |
| { | |
| return 0; | |
| } | |
| void* res = getSymbol_(handle, symbolName); | |
| if (!res) | |
| { | |
| CV_LOG_DEBUG(NULL, "No symbol '" << symbolName << "' in " << toPrintablePath(fname)); | |
| } | |
| return res; | |
| } | |
| std::string DynamicLib::getName() const | |
| { | |
| return toPrintablePath(fname); | |
| } | |
| void DynamicLib::libraryLoad(const FileSystemPath_t& filename) | |
| { | |
| handle = libraryLoad_(filename); | |
| CV_LOG_INFO(NULL, "load " << toPrintablePath(filename) << " => " << (handle ? "OK" : "FAILED")); | |
| } | |
| void DynamicLib::libraryRelease() | |
| { | |
| if (handle) | |
| { | |
| CV_LOG_INFO(NULL, "unload "<< toPrintablePath(fname)); | |
| libraryRelease_(handle); | |
| handle = 0; | |
| } | |
| } | |
| }}} // namespace | |