BsDynLibManager.h 976 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BsPrerequisitesUtil.h"
  3. #include "BsModule.h"
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup General
  7. * @{
  8. */
  9. /**
  10. * This manager keeps a track of all the open dynamic-loading libraries, opens them and returns references to
  11. * already-open libraries.
  12. *
  13. * @note Not thread safe.
  14. */
  15. class BS_UTILITY_EXPORT DynLibManager : public Module<DynLibManager>
  16. {
  17. public:
  18. DynLibManager();
  19. virtual ~DynLibManager();
  20. /**
  21. * Loads the given file as a dynamic library.
  22. *
  23. * @param[in] filename The name of the library. The extension can be omitted.
  24. */
  25. DynLib* load(const String& filename);
  26. /** Unloads the given library. */
  27. void unload(DynLib* lib);
  28. protected:
  29. Map<String, DynLib*> mLoadedLibraries;
  30. };
  31. /** Easy way of accessing DynLibManager. */
  32. BS_UTILITY_EXPORT DynLibManager& gDynLibManager();
  33. /** @} */
  34. }