diff options
Diffstat (limited to 'include/CompilerKit/Utilities/DLL.h')
| -rw-r--r-- | include/CompilerKit/Utilities/DLL.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/include/CompilerKit/Utilities/DLL.h b/include/CompilerKit/Utilities/DLL.h index 6f14c13..ea6789d 100644 --- a/include/CompilerKit/Utilities/DLL.h +++ b/include/CompilerKit/Utilities/DLL.h @@ -13,22 +13,23 @@ namespace CompilerKit { class DLLLoader final { public: - typedef Int32 (*EntryT)(Int32 argc, Char const* argv[]); - using DLL = VoidPtr; - using Mutex = std::mutex; + using EntryT = Int32 (*)(Int32 argc, Char const* argv[]); + using HandleT = VoidPtr; + using MutexT = std::mutex; + EntryT fEntrypoint{nullptr}; private: - DLL mDLL{nullptr}; - Mutex mMutex; + HandleT mDLL{nullptr}; + MutexT mMutex; public: - explicit operator bool() { return this->mDLL && this->fEntrypoint; } + explicit operator bool() { return this->mDLL; } - DLLLoader& operator()(const Char* path, const Char* fEntrypoint) { - if (!path || !fEntrypoint) return *this; + DLLLoader& operator()(const Char* path, const Char* entrypoint) { + if (!path || !entrypoint) return *this; - std::lock_guard<Mutex> lock(this->mMutex); + std::lock_guard<MutexT> lock(this->mMutex); if (this->mDLL) { this->Destroy(); @@ -40,7 +41,7 @@ class DLLLoader final { return *this; } - this->fEntrypoint = reinterpret_cast<EntryT>(::dlsym(this->mDLL, fEntrypoint)); + this->fEntrypoint = reinterpret_cast<EntryT>(::dlsym(this->mDLL, entrypoint)); if (!this->fEntrypoint) { this->Destroy(); @@ -52,7 +53,7 @@ class DLLLoader final { NECTI_COPY_DELETE(DLLLoader) - explicit DLLLoader() = default; + DLLLoader() = default; ~DLLLoader() { this->Destroy(); } private: @@ -65,4 +66,4 @@ class DLLLoader final { this->fEntrypoint = nullptr; } }; -} // namespace CompilerKit
\ No newline at end of file +} // namespace CompilerKit |
