ecllib.ecm 2.7 KB

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