summaryrefslogtreecommitdiffstats
path: root/xbmc/SectionLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/SectionLoader.h')
-rw-r--r--xbmc/SectionLoader.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/xbmc/SectionLoader.h b/xbmc/SectionLoader.h
new file mode 100644
index 0000000..20757c8
--- /dev/null
+++ b/xbmc/SectionLoader.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "threads/CriticalSection.h"
+
+#include <chrono>
+#include <string>
+#include <vector>
+
+// forward
+class LibraryLoader;
+
+class CSectionLoader
+{
+public:
+ class CDll
+ {
+ public:
+ std::string m_strDllName;
+ long m_lReferenceCount;
+ LibraryLoader *m_pDll;
+ std::chrono::time_point<std::chrono::steady_clock> m_unloadDelayStartTick;
+ bool m_bDelayUnload;
+ };
+ CSectionLoader(void);
+ virtual ~CSectionLoader(void);
+
+ static LibraryLoader* LoadDLL(const std::string& strSection, bool bDelayUnload=true, bool bLoadSymbols=false);
+ static void UnloadDLL(const std::string& strSection);
+ static void UnloadDelayed();
+ void UnloadAll();
+
+protected:
+ std::vector<CDll> m_vecLoadedDLLs;
+ CCriticalSection m_critSection;
+
+};
+
+extern CSectionLoader g_sectionLoader;
+