00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #if !defined(PSVIATTRIBUTEDERIVATION_LIST_HPP)
00046 #define PSVIATTRIBUTEDERIVATION_LIST_HPP
00047
00048 #include <xercesc/util/PlatformUtils.hpp>
00049 #include <xercesc/framework/psvi/PSVIAttribute.hpp>
00050 #include <xercesc/util/ValueVectorOf.hpp>
00051
00052 XERCES_CPP_NAMESPACE_BEGIN
00053
00063 class PSVIAttributeList : public XMemory
00064 {
00065 public:
00066
00067
00068
00071
00077 PSVIAttributeList( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00078
00080
00083 ~PSVIAttributeList();
00085
00086
00090
00091
00092
00093
00094
00095 unsigned int getLength() const;
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 PSVIAttribute *getAttributePSVIAtIndex(const unsigned int index);
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115 const XMLCh *getAttributeNameAtIndex(const unsigned int index);
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 const XMLCh *getAttributeNamespaceAtIndex(const unsigned int index);
00126
00127
00128
00129
00130
00131
00132
00133
00134 PSVIAttribute *getAttributePSVIByName(const XMLCh *attrName
00135 , const XMLCh * attrNamespace);
00136
00138
00139
00143
00152 PSVIAttribute *getPSVIAttributeToFill(
00153 const XMLCh * attrName
00154 , const XMLCh * attrNS);
00155
00159 void reset();
00160
00162
00163 private:
00164
00165
00166
00167
00168 PSVIAttributeList(const PSVIAttributeList&);
00169 PSVIAttributeList & operator=(const PSVIAttributeList &);
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187 MemoryManager* fMemoryManager;
00188 RefVectorOf<PSVIAttribute>* fAttrList;
00189 RefArrayVectorOf<XMLCh>* fAttrNameList;
00190 RefArrayVectorOf<XMLCh>* fAttrNSList;
00191 unsigned int fAttrPos;
00192 };
00193 inline PSVIAttributeList::~PSVIAttributeList()
00194 {
00195 delete fAttrList;
00196 delete fAttrNameList;
00197 delete fAttrNSList;
00198 }
00199
00200 inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(
00201 const XMLCh *attrName
00202 , const XMLCh * attrNS)
00203 {
00204 PSVIAttribute *retAttr = 0;
00205 if(fAttrPos == fAttrList->size())
00206 {
00207 retAttr = new (fMemoryManager)PSVIAttribute(fMemoryManager);
00208 fAttrList->addElement(retAttr);
00209 fAttrNameList->addElement((XMLCh *)attrName);
00210 fAttrNSList->addElement((XMLCh *)attrNS);
00211 }
00212 else
00213 {
00214 retAttr = fAttrList->elementAt(fAttrPos);
00215 fAttrNameList->setElementAt((XMLCh *)attrName, fAttrPos);
00216 fAttrNSList->setElementAt((XMLCh *)attrNS, fAttrPos);
00217 }
00218 fAttrPos++;
00219 return retAttr;
00220 }
00221
00222 inline void PSVIAttributeList::reset()
00223 {
00224 fAttrPos = 0;
00225 }
00226
00227 XERCES_CPP_NAMESPACE_END
00228
00229 #endif