kodi
SectionLoader.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "threads/CriticalSection.h"
12 
13 #include <chrono>
14 #include <string>
15 #include <vector>
16 
17 // forward
18 class LibraryLoader;
19 
21 {
22 public:
23  class CDll
24  {
25  public:
26  std::string m_strDllName;
27  long m_lReferenceCount;
28  LibraryLoader *m_pDll;
29  std::chrono::time_point<std::chrono::steady_clock> m_unloadDelayStartTick;
30  bool m_bDelayUnload;
31  };
32  CSectionLoader(void);
33  virtual ~CSectionLoader(void);
34 
35  static LibraryLoader* LoadDLL(const std::string& strSection, bool bDelayUnload=true, bool bLoadSymbols=false);
36  static void UnloadDLL(const std::string& strSection);
37  static void UnloadDelayed();
38  void UnloadAll();
39 
40 protected:
41  std::vector<CDll> m_vecLoadedDLLs;
42  CCriticalSection m_critSection;
43 
44 };
45 
46 extern CSectionLoader g_sectionLoader;
47 
Definition: LibraryLoader.h:17
Definition: SectionLoader.h:20
Definition: SectionLoader.h:23