Warning, file /include/xercesc/validators/schema/identity/IdentityConstraint.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HPP)
0023 #define XERCESC_INCLUDE_GUARD_IDENTITYCONSTRAINT_HPP
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #include <xercesc/util/RefVectorOf.hpp>
0034 #include <xercesc/validators/schema/identity/IC_Field.hpp>
0035
0036 #include <xercesc/internal/XSerializable.hpp>
0037
0038 XERCES_CPP_NAMESPACE_BEGIN
0039
0040
0041
0042
0043 class IC_Selector;
0044
0045 class VALIDATORS_EXPORT IdentityConstraint : public XSerializable, public XMemory
0046 {
0047 public:
0048
0049
0050
0051 enum ICType {
0052 ICType_UNIQUE = 0,
0053 ICType_KEY = 1,
0054 ICType_KEYREF = 2,
0055 ICType_UNKNOWN
0056 };
0057
0058
0059
0060
0061 virtual ~IdentityConstraint();
0062
0063
0064
0065
0066 bool operator== (const IdentityConstraint& other) const;
0067 bool operator!= (const IdentityConstraint& other) const;
0068
0069
0070
0071
0072 virtual short getType() const = 0;
0073 XMLSize_t getFieldCount() const;
0074 XMLCh* getIdentityConstraintName() const;
0075 XMLCh* getElementName() const;
0076 IC_Selector* getSelector() const;
0077 int getNamespaceURI() const;
0078
0079
0080
0081
0082 void setSelector(IC_Selector* const selector);
0083 void setNamespaceURI(int uri);
0084
0085
0086
0087
0088 void addField(IC_Field* const field);
0089 const IC_Field* getFieldAt(const XMLSize_t index) const;
0090 IC_Field* getFieldAt(const XMLSize_t index);
0091
0092
0093
0094
0095 DECL_XSERIALIZABLE(IdentityConstraint)
0096
0097 static void storeIC(XSerializeEngine& serEng
0098 , IdentityConstraint* const ic);
0099
0100 static IdentityConstraint* loadIC(XSerializeEngine& serEng);
0101
0102 protected:
0103
0104
0105
0106 IdentityConstraint(const XMLCh* const identityConstraintName,
0107 const XMLCh* const elementName,
0108 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
0109
0110 private:
0111
0112
0113
0114 IdentityConstraint(const IdentityConstraint& other);
0115 IdentityConstraint& operator= (const IdentityConstraint& other);
0116
0117
0118
0119
0120 void cleanUp();
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137 XMLCh* fIdentityConstraintName;
0138 XMLCh* fElemName;
0139 IC_Selector* fSelector;
0140 RefVectorOf<IC_Field>* fFields;
0141 MemoryManager* fMemoryManager;
0142 int fNamespaceURI;
0143 };
0144
0145
0146
0147
0148
0149 inline XMLSize_t IdentityConstraint::getFieldCount() const {
0150
0151 if (fFields) {
0152 return fFields->size();
0153 }
0154
0155 return 0;
0156 }
0157
0158 inline XMLCh* IdentityConstraint::getIdentityConstraintName() const {
0159
0160 return fIdentityConstraintName;
0161 }
0162
0163 inline XMLCh* IdentityConstraint::getElementName() const {
0164
0165 return fElemName;
0166 }
0167
0168 inline IC_Selector* IdentityConstraint::getSelector() const {
0169
0170 return fSelector;
0171 }
0172
0173 inline int IdentityConstraint::getNamespaceURI() const
0174 {
0175 return fNamespaceURI;
0176 }
0177
0178
0179
0180
0181 inline void IdentityConstraint::setNamespaceURI(int uri)
0182 {
0183 fNamespaceURI = uri;
0184 }
0185
0186
0187
0188
0189 inline void IdentityConstraint::addField(IC_Field* const field) {
0190
0191 if (!fFields) {
0192 fFields = new (fMemoryManager) RefVectorOf<IC_Field>(4, true, fMemoryManager);
0193 }
0194
0195 fFields->addElement(field);
0196 }
0197
0198 inline const IC_Field* IdentityConstraint::getFieldAt(const XMLSize_t index) const {
0199
0200 if (fFields) {
0201 return (fFields->elementAt(index));
0202 }
0203
0204 return 0;
0205 }
0206
0207 inline IC_Field* IdentityConstraint::getFieldAt(const XMLSize_t index) {
0208
0209 if (fFields) {
0210 return (fFields->elementAt(index));
0211 }
0212
0213 return 0;
0214 }
0215
0216 XERCES_CPP_NAMESPACE_END
0217
0218 #endif
0219
0220
0221
0222
0223