dllserver.hpp 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 DLLSERVER_EXPORTS
  16. #define DLLSERVER_API DECL_EXPORT
  17. #else
  18. #define DLLSERVER_API DECL_IMPORT
  19. #endif
  20. #include "jiface.hpp"
  21. class IpAddress;
  22. class RemoteFilename;
  23. class MemoryBuffer;
  24. class StringBuffer;
  25. interface IJlibDateTime;
  26. enum DllLocationType
  27. {
  28. DllLocationNowhere = 0,
  29. DllLocationAnywhere = 1,
  30. DllLocationDomain = 2,
  31. DllLocationLocal = 3,
  32. DllLocationDirectory = 4,
  33. DllLocationSize = 5
  34. };
  35. interface IDllLocation : extends IInterface
  36. {
  37. virtual void getDllFilename(RemoteFilename & filename) = 0;
  38. virtual bool getLibFilename(RemoteFilename & filename) = 0;
  39. virtual void getIP(IpAddress & ip) = 0;
  40. virtual DllLocationType queryLocation() = 0;
  41. virtual void remove(bool removeFiles, bool removeDirectory) = 0;
  42. };
  43. interface IDllEntry : extends IInterface
  44. {
  45. virtual IIterator * createLocationIterator() = 0;
  46. virtual IDllLocation * getBestLocation() = 0;
  47. virtual IDllLocation * getBestLocationCandidate() = 0;
  48. virtual void getCreated(IJlibDateTime & dateTime) = 0;
  49. virtual const char * queryKind() = 0;
  50. virtual const char * queryName() = 0;
  51. virtual void remove(bool removeFiles, bool removeDirectory) = 0;
  52. };
  53. interface ILoadedDllEntry;
  54. interface IDllServer : extends IInterface
  55. {
  56. virtual IIterator * createDllIterator() = 0;
  57. virtual void ensureAvailable(const char * name, DllLocationType location) = 0;
  58. virtual void getDll(const char * name, MemoryBuffer & dllText) = 0;
  59. virtual IDllEntry * getEntry(const char * name) = 0;
  60. virtual void getLibrary(const char * name, MemoryBuffer & dllText) = 0;
  61. virtual void getLocalLibraryName(const char * name, StringBuffer & libraryName) = 0;
  62. virtual DllLocationType isAvailable(const char * name) = 0;
  63. virtual ILoadedDllEntry * loadDll(const char * name, DllLocationType location) = 0;
  64. virtual void removeDll(const char * name, bool removeDlls, bool removeDirectory) = 0;
  65. virtual void registerDll(const char * name, const char * kind, const char * dllPath) = 0;
  66. virtual IDllEntry * createEntry(IPropertyTree *owner, IPropertyTree *entry) = 0;
  67. };
  68. extern DLLSERVER_API IDllServer & queryDllServer();
  69. extern DLLSERVER_API void closeDllServer();
  70. extern DLLSERVER_API void initDllServer(const char * localRoot);
  71. extern DLLSERVER_API void testDllServer();
  72. #endif