ecllib.ecm 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 ECL_CLIENT_API
  14. #define ECL_CLIENT_API __declspec(dllimport)
  15. #endif
  16. SCMenum InstantEclState
  17. {
  18. ECL_OK,
  19. ECL_CONNECTION_ERROR,
  20. ECL_NORMAL_ERROR
  21. };
  22. // IClientInstantEclResp is used to access the result set of the query
  23. //
  24. SCMInterface IClientInstantEclResp(IInterface)
  25. {
  26. virtual unsigned long getRequestId() = 0;
  27. virtual unsigned long getClientValue() = 0;
  28. virtual InstantEclState getState() = 0;
  29. virtual const char *getResultsXML() = 0;
  30. };
  31. // IClientInstantEclRequest is used to set up a simple ECL query
  32. //
  33. SCMInterface IClientInstantEclRequest(IInterface)
  34. {
  35. virtual void setUser(const char* user) = 0;
  36. virtual void setUserToken(const char* user, const char* password) = 0;
  37. virtual void setEclServer(const char* eclserver) = 0;
  38. virtual void setCluster(const char* cluster) = 0;
  39. virtual void setClientValue(unsigned long cv) = 0;
  40. virtual void setEclText(const char *text) = 0;
  41. };
  42. SCMinterface IClientInstantEclEvents(IInterface)
  43. {
  44. virtual int onComplete(IClientInstantEclResp &resp) = 0;
  45. virtual int onError(IClientInstantEclResp &resp) = 0;
  46. //virtual int onProgress(IClientInstantEclResp &resp) = 0;
  47. //virtual int onCancelled(IClientInstantEclResp &resp) = 0;
  48. };
  49. SCMInterface IClientInstantEcl(IInterface)
  50. {
  51. virtual void addServiceUrl(const char * url) = 0;
  52. virtual void removeServiceUrl(const char *url) = 0;
  53. virtual IClientInstantEclRequest* createRequest() = 0;
  54. virtual IClientInstantEclResp* runEcl(IClientInstantEclRequest* request) = 0;
  55. virtual void runEclAsync(IClientInstantEclRequest* request, IClientInstantEclEvents &events) = 0;
  56. };
  57. extern "C" ECL_CLIENT_API IClientInstantEcl * createInstantEclClient();
  58. SCMclarion
  59. map
  60. module('instant ecl client')
  61. createInstantEclClient procedure, *cppClientInstantEcl, pascal, raw, name('_createInstantEclClient@0')
  62. end
  63. end
  64. SCMend