hqlcollect.hpp 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 _HQLCOLLECT_HPP_
  14. #define _HQLCOLLECT_HPP_
  15. #include "hql.hpp"
  16. typedef unsigned __int64 timestamp_t;
  17. //An opaque type which can be linked.
  18. interface IEclUser : public IInterface
  19. {
  20. };
  21. interface IXmlEclRepository : public IInterface
  22. {
  23. public:
  24. virtual int getModules(StringBuffer & xml, IEclUser * user, timestamp_t timestamp) = 0;
  25. virtual int getAttributes(StringBuffer & xml, IEclUser * user, const char * modname, const char * attribute, int version, unsigned char infoLevel, const char * snapshot, bool sandbox4snapshot) = 0;
  26. };
  27. //---------------------------------------------------------------------------------------------------------------------
  28. enum EclSourceType { ESTnone,
  29. ESTdefinition, ESTmodule,
  30. ESTlibrary, ESTplugin,
  31. ESTcontainer = 0x10 };
  32. interface IProperties;
  33. interface IFileContents;
  34. interface IEclSource : public IInterface
  35. {
  36. virtual IFileContents * queryFileContents() = 0;
  37. virtual IProperties * getProperties() = 0;
  38. virtual IIdAtom * queryEclId() const = 0;
  39. virtual EclSourceType queryType() const = 0;
  40. inline bool isImplicitModule() const
  41. {
  42. EclSourceType type = queryType();
  43. return (type==ESTlibrary) || (type==ESTplugin);
  44. }
  45. //virtual bool isPluginDllScope(IHqlScope * scope)
  46. //virtual bool allowImplicitImport(IHqlScope * scope)
  47. };
  48. typedef IIteratorOf<IEclSource> IEclSourceIterator;
  49. interface IEclSourceCollection : public IInterface
  50. {
  51. virtual IEclSource * getSource(IEclSource * optParent, IIdAtom * eclName) = 0;
  52. virtual IEclSourceIterator * getContained(IEclSource * optParent) = 0;
  53. virtual void checkCacheValid() = 0;
  54. };
  55. typedef IArrayOf<IEclSourceCollection> EclSourceCollectionArray;
  56. //---------------------------------------------------------------------------------------------------------------------
  57. enum EclSourceCollectionFlags {
  58. ESFnone = 0,
  59. ESFallowplugins = 0x0001,
  60. };
  61. extern HQL_API IEclSourceCollection * createFileSystemEclCollection(IErrorReceiver *errs, const char * path, unsigned flags, unsigned trace);
  62. extern HQL_API IEclSourceCollection * createArchiveEclCollection(IPropertyTree * tree);
  63. extern HQL_API IEclSourceCollection * createSingleDefinitionEclCollection(const char * moduleName, const char * attrName, IFileContents * contents);
  64. extern HQL_API IEclSourceCollection * createSingleDefinitionEclCollection(const char * attrName, IFileContents * contents);
  65. extern HQL_API IEclSourceCollection * createRemoteXmlEclCollection(IEclUser * user, IXmlEclRepository & repository, const char * snapshot, bool useSandbox);
  66. extern HQL_API IXmlEclRepository * createArchiveXmlEclRepository(IPropertyTree * archive);
  67. extern HQL_API IXmlEclRepository * createReplayXmlEclRepository(IPropertyTree * xml);
  68. #endif