BuildSet.hpp 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*##############################################################################
  2. HPCC SYSTEMS software Copyright (C) 2015 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 _BUILD_SET_HPP_
  14. #define _BUILD_SET_HPP_
  15. #include "jstring.hpp"
  16. #include "jlib.hpp"
  17. #include "build-config.h"
  18. namespace CONFIGURATOR
  19. {
  20. static const char* DEFAULT_BUILD_SET_XML_FILE("buildset.xml");
  21. static const char* DEFAULT_BUILD_SET_DIRECTORY(COMPONENTFILES_DIR"/configxml/");
  22. class CBuildSet;
  23. class CBuildSetManager
  24. {
  25. public:
  26. static CBuildSetManager* getInstance(const char* pBuildSetFile = NULL, const char* pBuildSetDirectory = NULL);
  27. virtual ~CBuildSetManager();
  28. void getBuildSetComponents(::StringArray& buildSetArray) const;
  29. void getBuildSetServices(::StringArray& buildSetArray) const;
  30. void setBuildSetArray(const ::StringArray &strArray);
  31. const char* getBuildSetServiceName(int index) const;
  32. const char* getBuildSetServiceFileName(int index) const;
  33. const char* getBuildSetComponentTypeName(int index) const;
  34. const char* getBuildSetComponentFileName(int index) const;
  35. const char* getBuildSetProcessName(int index) const;
  36. const char* getBuildSetSchema(unsigned index) const;
  37. const int getBuildSetSchemaCount() const;
  38. const int getBuildSetServiceCount() const;
  39. const int getBuildSetComponentCount() const;
  40. bool populateBuildSet();
  41. protected:
  42. CBuildSetManager();
  43. CBuildSetManager(const char* pBuildSetFile, const char* pBuildSetDir);
  44. const CBuildSet* getBuildSetComponent(int index) const;
  45. const CBuildSet* getBuildSetService(int index) const;
  46. CIArrayOf<CBuildSet> m_buildSetArray;
  47. Owned<IPropertyTree> m_buildSetTree;
  48. StringBuffer m_buildSetFile;
  49. StringBuffer m_buildSetDir;
  50. StringBuffer m_buildSetPath;
  51. };
  52. class CBuildSet : public CInterface
  53. {
  54. public:
  55. IMPLEMENT_IINTERFACE
  56. CBuildSet(const char* pInstallSet = NULL, const char* pName = NULL, const char* pProcessName = NULL, const char* pSchema = NULL, const char* pDeployable = NULL, const char *pOverride = NULL) : m_pInstallSet(pInstallSet), m_pName(pName), m_pProcessName(pProcessName), m_pSchema(pSchema), m_pDeployable(pDeployable), m_pOverride(pOverride)
  57. {
  58. }
  59. virtual ~CBuildSet()
  60. {
  61. }
  62. const char* getInstallSet() const
  63. {
  64. return m_pInstallSet;
  65. }
  66. const char* getName() const
  67. {
  68. return m_pName;
  69. }
  70. const char* getProcessName() const
  71. {
  72. return m_pProcessName;
  73. }
  74. const char* getSchema() const
  75. {
  76. return m_pSchema;
  77. }
  78. const char* getDeployable() const
  79. {
  80. return m_pDeployable;
  81. }
  82. const char* getOverride() const
  83. {
  84. return m_pOverride;
  85. }
  86. protected:
  87. CBuildSet();
  88. CBuildSet(const CBuildSet& buildSet) : m_pInstallSet(buildSet.m_pInstallSet), m_pName(buildSet.m_pName), m_pProcessName(buildSet.m_pProcessName), m_pSchema(buildSet.m_pSchema), m_pDeployable(buildSet.m_pDeployable)
  89. {}
  90. const char* m_pInstallSet;
  91. const char* m_pName;
  92. const char* m_pProcessName;
  93. const char* m_pSchema;
  94. const char* m_pDeployable;
  95. const char* m_pOverride;
  96. private:
  97. };
  98. }
  99. #endif // _BUILD_SET_HPP_