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 
00046 
00047 
00048 
00049 
00050 
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 
00081 
00082 #if !defined(PSVIATTRIBUTEDERIVATION_LIST_HPP)
00083 #define PSVIATTRIBUTEDERIVATION_LIST_HPP
00084 
00085 #include <xercesc/util/PlatformUtils.hpp>
00086 #include <xercesc/framework/psvi/PSVIAttribute.hpp>
00087 #include <xercesc/util/ValueVectorOf.hpp>
00088 
00089 XERCES_CPP_NAMESPACE_BEGIN
00090 
00100 class  PSVIAttributeList : public XMemory
00101 {
00102 public:
00103 
00104     
00105     
00108 
00114     PSVIAttributeList( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
00115 
00117 
00120     ~PSVIAttributeList();
00122 
00123     
00127 
00128     
00129 
00130 
00131 
00132     unsigned int getLength() const;
00133 
00134     
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142     PSVIAttribute *getAttributePSVIAtIndex(const unsigned int index);
00143 
00144     
00145 
00146 
00147 
00148 
00149 
00150 
00151 
00152     const XMLCh *getAttributeNameAtIndex(const unsigned int index);
00153 
00154     
00155 
00156 
00157 
00158 
00159 
00160 
00161 
00162     const XMLCh *getAttributeNamespaceAtIndex(const unsigned int index);
00163 
00164     
00165 
00166 
00167 
00168 
00169 
00170 
00171     PSVIAttribute *getAttributePSVIByName(const XMLCh *attrName
00172                     , const XMLCh * attrNamespace);
00173 
00175 
00176     
00180 
00189     PSVIAttribute *getPSVIAttributeToFill(
00190             const XMLCh * attrName
00191             , const XMLCh * attrNS);
00192 
00196     void reset();
00197 
00199 
00200 private:
00201 
00202     
00203     
00204     
00205     PSVIAttributeList(const PSVIAttributeList&);
00206     PSVIAttributeList & operator=(const PSVIAttributeList &);
00207 
00208 
00209     
00210     
00211     
00212     
00213     
00214     
00215     
00216     
00217     
00218     
00219     
00220     
00221     
00222     
00223     
00224     MemoryManager*                  fMemoryManager;    
00225     RefVectorOf<PSVIAttribute>*     fAttrList;
00226     RefArrayVectorOf<XMLCh>*        fAttrNameList;
00227     RefArrayVectorOf<XMLCh>*        fAttrNSList;
00228     unsigned int                    fAttrPos;
00229 };
00230 inline PSVIAttributeList::~PSVIAttributeList() 
00231 {
00232     delete fAttrList;
00233     delete fAttrNameList;
00234     delete fAttrNSList;
00235 }
00236 
00237 inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(
00238             const XMLCh *attrName
00239             , const XMLCh * attrNS)
00240 {
00241     PSVIAttribute *retAttr = 0;
00242     if(fAttrPos == fAttrList->size())
00243     {
00244         retAttr = new (fMemoryManager)PSVIAttribute(fMemoryManager);
00245         fAttrList->addElement(retAttr);
00246         fAttrNameList->addElement((XMLCh *)attrName);
00247         fAttrNSList->addElement((XMLCh *)attrNS);
00248     }
00249     else
00250     {
00251         retAttr = fAttrList->elementAt(fAttrPos);
00252         fAttrNameList->setElementAt((XMLCh *)attrName, fAttrPos);
00253         fAttrNSList->setElementAt((XMLCh *)attrNS, fAttrPos);
00254     }
00255     fAttrPos++;
00256     return retAttr;
00257 }
00258 
00259 inline void PSVIAttributeList::reset()
00260 {
00261     fAttrPos = 0;
00262 }
00263 
00264 XERCES_CPP_NAMESPACE_END
00265 
00266 #endif