dllserver.hpp 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ############################################################################## */
  13. #ifndef DLLSERVER_INCL
  14. #define DLLSERVER_INCL
  15. #ifdef _WIN32
  16. #ifdef DLLSERVER_EXPORTS
  17. #define DLLSERVER_API __declspec(dllexport)
  18. #else
  19. #define DLLSERVER_API __declspec(dllimport)
  20. #endif
  21. #else
  22. #define DLLSERVER_API
  23. #endif
  24. #include "jiface.hpp"
  25. class IpAddress;
  26. class RemoteFilename;
  27. class MemoryBuffer;
  28. class StringBuffer;
  29. interface IJlibDateTime;
  30. enum DllLocationType
  31. {
  32. DllLocationNowhere = 0,
  33. DllLocationAnywhere = 1,
  34. DllLocationDomain = 2,
  35. DllLocationLocal = 3,
  36. DllLocationDirectory = 4,
  37. DllLocationSize = 5
  38. };
  39. interface IDllLocation : extends IInterface
  40. {
  41. virtual void getDllFilename(RemoteFilename & filename) = 0;
  42. virtual bool getLibFilename(RemoteFilename & filename) = 0;
  43. virtual void getIP(IpAddress & ip) = 0;
  44. virtual DllLocationType queryLocation() = 0;
  45. virtual void remove(bool removeFiles, bool removeDirectory) = 0;
  46. };
  47. interface IDllEntry : extends IInterface
  48. {
  49. virtual IIterator * createLocationIterator() = 0;
  50. virtual IDllLocation * getBestLocation() = 0;
  51. virtual IDllLocation * getBestLocationCandidate() = 0;
  52. virtual void getCreated(IJlibDateTime & dateTime) = 0;
  53. virtual const char * queryKind() = 0;
  54. virtual const char * queryName() = 0;
  55. virtual void remove(bool removeFiles, bool removeDirectory) = 0;
  56. };
  57. interface ILoadedDllEntry;
  58. interface IDllServer : extends IInterface
  59. {
  60. virtual IIterator * createDllIterator() = 0;
  61. virtual void ensureAvailable(const char * name, DllLocationType location) = 0;
  62. virtual void getDll(const char * name, MemoryBuffer & dllText) = 0;
  63. virtual IDllEntry * getEntry(const char * name) = 0;
  64. virtual void getLibrary(const char * name, MemoryBuffer & dllText) = 0;
  65. virtual void getLocalLibraryName(const char * name, StringBuffer & libraryName) = 0;
  66. virtual DllLocationType isAvailable(const char * name) = 0;
  67. virtual ILoadedDllEntry * loadDll(const char * name, DllLocationType location) = 0;
  68. virtual void removeDll(const char * name, bool removeDlls, bool removeDirectory) = 0;
  69. virtual void registerDll(const char * name, const char * kind, const char * dllPath) = 0;
  70. virtual IDllEntry * createEntry(IPropertyTree *owner, IPropertyTree *entry) = 0;
  71. };
  72. extern DLLSERVER_API IDllServer & queryDllServer();
  73. extern DLLSERVER_API void closeDllServer();
  74. extern DLLSERVER_API void initDllServer(const char * localRoot);
  75. extern DLLSERVER_API void testDllServer();
  76. #endif