dllserver.hpp 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. #ifndef DLLSERVER_INCL
  15. #define DLLSERVER_INCL
  16. #ifdef _WIN32
  17. #ifdef DLLSERVER_EXPORTS
  18. #define DLLSERVER_API __declspec(dllexport)
  19. #else
  20. #define DLLSERVER_API __declspec(dllimport)
  21. #endif
  22. #else
  23. #define DLLSERVER_API
  24. #endif
  25. #include "jiface.hpp"
  26. class IpAddress;
  27. class RemoteFilename;
  28. class MemoryBuffer;
  29. class StringBuffer;
  30. interface IJlibDateTime;
  31. enum DllLocationType
  32. {
  33. DllLocationNowhere = 0,
  34. DllLocationAnywhere = 1,
  35. DllLocationDomain = 2,
  36. DllLocationLocal = 3,
  37. DllLocationDirectory = 4,
  38. DllLocationSize = 5
  39. };
  40. interface IDllLocation : extends IInterface
  41. {
  42. virtual void getDllFilename(RemoteFilename & filename) = 0;
  43. virtual bool getLibFilename(RemoteFilename & filename) = 0;
  44. virtual void getIP(IpAddress & ip) = 0;
  45. virtual DllLocationType queryLocation() = 0;
  46. virtual void remove(bool removeFiles, bool removeDirectory) = 0;
  47. };
  48. interface IDllEntry : extends IInterface
  49. {
  50. virtual IIterator * createLocationIterator() = 0;
  51. virtual IDllLocation * getBestLocation() = 0;
  52. virtual IDllLocation * getBestLocationCandidate() = 0;
  53. virtual void getCreated(IJlibDateTime & dateTime) = 0;
  54. virtual const char * queryKind() = 0;
  55. virtual const char * queryName() = 0;
  56. virtual void remove(bool removeFiles, bool removeDirectory) = 0;
  57. };
  58. interface ILoadedDllEntry;
  59. interface IDllServer : extends IInterface
  60. {
  61. virtual IIterator * createDllIterator() = 0;
  62. virtual void ensureAvailable(const char * name, DllLocationType location) = 0;
  63. virtual void getDll(const char * name, MemoryBuffer & dllText) = 0;
  64. virtual IDllEntry * getEntry(const char * name) = 0;
  65. virtual void getLibrary(const char * name, MemoryBuffer & dllText) = 0;
  66. virtual void getLocalLibraryName(const char * name, StringBuffer & libraryName) = 0;
  67. virtual DllLocationType isAvailable(const char * name) = 0;
  68. virtual ILoadedDllEntry * loadDll(const char * name, DllLocationType location) = 0;
  69. virtual void removeDll(const char * name, bool removeDlls, bool removeDirectory) = 0;
  70. virtual void registerDll(const char * name, const char * kind, const char * dllPath) = 0;
  71. };
  72. extern "C" DLLSERVER_API IDllServer & queryDllServer();
  73. extern "C" DLLSERVER_API void closeDllServer();
  74. extern "C" DLLSERVER_API void initDllServer(const char * localRoot);
  75. extern DLLSERVER_API void testDllServer();
  76. #endif