cmDynamicLoader.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. // .NAME cmDynamicLoader - class interface to system dynamic libraries
  14. // .SECTION Description
  15. // cmDynamicLoader provides a portable interface to loading dynamic
  16. // libraries into a process.
  17. #ifndef __cmDynamicLoader_h
  18. #define __cmDynamicLoader_h
  19. #include "cmStandardIncludes.h"
  20. #include <cmsys/DynamicLoader.hxx>
  21. class cmDynamicLoader
  22. {
  23. public:
  24. // Description:
  25. // Load a dynamic library into the current process.
  26. // The returned cmsys::DynamicLoader::LibraryHandle can be used to access
  27. // the symbols in the library.
  28. static cmsys::DynamicLoader::LibraryHandle OpenLibrary(const char*);
  29. // Description:
  30. // Return the library prefix for the given architecture
  31. static const char* LibPrefix();
  32. // Description:
  33. // Return the library extension for the given architecture
  34. static const char* LibExtension();
  35. // Description:
  36. // Flush the cache of dynamic loader.
  37. static void FlushCache();
  38. protected:
  39. cmDynamicLoader() {};
  40. ~cmDynamicLoader() {};
  41. private:
  42. cmDynamicLoader(const cmDynamicLoader&); // Not implemented.
  43. void operator=(const cmDynamicLoader&); // Not implemented.
  44. };
  45. #endif