SchemaKeyRef.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 _SCHEMA_KEYREF_HPP_
  14. #define _SCHEMA_KEYREF_HPP_
  15. #include "jstring.hpp"
  16. #include "SchemaCommon.hpp"
  17. class CSelector;
  18. class CFieldArray;
  19. namespace CONFIGURATOR
  20. {
  21. class CKeyRef : public CXSDNode
  22. {
  23. public:
  24. virtual ~CKeyRef()
  25. {
  26. }
  27. virtual void dump(::std::ostream &cout, unsigned int offset = 0) const;
  28. virtual void populateEnvXPath(::StringBuffer strXPath, unsigned int index = 1);
  29. bool checkConstraint(const char *pValue) const;
  30. virtual void getDocumentation(::StringBuffer &strDoc) const
  31. {
  32. UNIMPLEMENTED;
  33. }
  34. static CKeyRef* load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath);
  35. GETTERSETTER(Name)
  36. GETTERSETTER(ID)
  37. GETTERSETTER(Refer)
  38. protected:
  39. CKeyRef(CXSDNodeBase* pParentNode) : CXSDNode::CXSDNode(pParentNode, XSD_KEYREF), m_pFieldArray(NULL), m_pSelector(NULL)
  40. {
  41. }
  42. CFieldArray *m_pFieldArray;
  43. CSelector *m_pSelector;
  44. };
  45. class CKeyRefArray : public ::CIArrayOf<CKeyRef>, public InterfaceImpl, public CXSDNodeBase
  46. {
  47. public:
  48. virtual ~CKeyRefArray()
  49. {
  50. }
  51. virtual void dump(::std::ostream& cout, unsigned int offset = 0) const;
  52. virtual void populateEnvXPath(::StringBuffer strXPath, unsigned int index = 1);
  53. virtual void getDocumentation(::StringBuffer &strDoc) const
  54. {
  55. UNIMPLEMENTED;
  56. }
  57. virtual void loadXMLFromEnvXml(const ::IPropertyTree *pEnvTree)
  58. {
  59. UNIMPLEMENTED;
  60. }
  61. static CKeyRefArray* load(CXSDNodeBase* pParentNode, const ::IPropertyTree *pSchemaRoot, const char* xpath);
  62. protected:
  63. CKeyRefArray(CXSDNodeBase* pParentNode = NULL) : CXSDNodeBase::CXSDNodeBase(pParentNode, XSD_KEYREF_ARRAY)
  64. {
  65. }
  66. };
  67. }
  68. #endif // _SCHEMA_KeyRef_HPP_