hqlecl.hpp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 HQLECL_INCL
  14. #define HQLECL_INCL
  15. #include "jcomp.hpp"
  16. #include "workunit.hpp"
  17. #include "hql.hpp"
  18. #include "hqlcpp.hpp"
  19. #include "hqlexpr.hpp"
  20. interface IWorkUnit;
  21. extern HQLCPP_API double getECLcomplexity(IHqlExpression * exprs, IErrorReceiver * errs, IWorkUnit *wu, ClusterType targetClusterType);
  22. extern HQLCPP_API void dumpActivityCounts();
  23. enum EclGenerateTarget {
  24. EclGenerateNone,
  25. EclGenerateCpp,
  26. EclGenerateDll,
  27. EclGenerateExe
  28. };
  29. interface IHqlExprDllGenerator : extends IInterface
  30. {
  31. public:
  32. virtual void addLibrary(const char * name) = 0;
  33. virtual bool generateDll(ICppCompiler * _compiler) = 0;
  34. virtual bool generateExe(ICppCompiler * _compiler) = 0;
  35. virtual bool generatePackage(const char * packageName) = 0;
  36. virtual offset_t getGeneratedSize() const = 0;
  37. virtual bool processQuery(OwnedHqlExpr & parsedQuery, EclGenerateTarget generateTarget) = 0;
  38. virtual void setMaxCompileThreads(unsigned max) = 0;
  39. virtual void addManifest(const char *filename) = 0;
  40. virtual void addManifestFromArchive(IPropertyTree *archive) = 0;
  41. virtual void addWebServiceInfo(IPropertyTree *wsinfo) = 0;
  42. virtual void setSaveGeneratedFiles(bool value) = 0;
  43. };
  44. extern HQLCPP_API IHqlExprDllGenerator * createDllGenerator(IErrorReceiver * errs, const char *wuname, const char * targetdir, IWorkUnit *wu, const char * template_dir, ClusterType targetClusterType, ICodegenContextCallback * ctxCallback, bool checkForLocalFileUploads, bool okToAbort);
  45. //Extract a single level of external libraries.
  46. extern HQLCPP_API ClusterType queryClusterType(IConstWorkUnit * wu, ClusterType prevType);
  47. extern HQLCPP_API IHqlExpression * extractExternalLibraries(HqlExprArray & libraries, IHqlExpression * query);
  48. extern HQLCPP_API unsigned getLibraryCRC(IHqlExpression * library);
  49. extern HQLCPP_API void setWorkunitHash(IWorkUnit * wu, IHqlExpression * expr);
  50. #endif