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 #if !defined(XSNAMEDMAP_HPP)
00072 #define XSNAMEDMAP_HPP
00073 
00074 
00075 #include <xercesc/util/XMemory.hpp>
00076 #include <xercesc/util/RefHash2KeysTableOf.hpp>
00077 
00078 XERCES_CPP_NAMESPACE_BEGIN
00079 
00080 class XMLStringPool;
00081 
00082 
00083 
00084 
00085 
00086 
00087 
00088 template <class TVal> class XSNamedMap: public XMemory
00089 {
00090 public:
00091     
00092     
00093     
00096 
00097     XSNamedMap(const unsigned int maxElems,
00098         const unsigned int modulus,
00099         XMLStringPool* uriStringPool,
00100         const bool adoptElems,
00101         MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00102     );
00104 
00107     ~XSNamedMap();
00108 
00110 
00111     
00112     
00113     
00116 
00122     unsigned int getLength();
00123 
00133     TVal *item(unsigned int index);
00134 
00146     TVal *itemByName(const XMLCh *compNamespace, 
00147                               const XMLCh *localName);
00148 
00150 
00151     
00155     void addElement(TVal* const toAdd, const XMLCh* key1, const XMLCh* key2);
00157     
00158 
00159 private :
00160     
00161     
00162     
00163     XSNamedMap(const XSNamedMap<TVal>&);
00164     XSNamedMap<TVal>& operator=(const XSNamedMap<TVal>&);
00165 
00166     
00167     
00168     
00169     
00170     
00171     MemoryManager *const        fMemoryManager;
00172     XMLStringPool*              fURIStringPool;
00173     RefVectorOf<TVal>*          fVector;
00174     RefHash2KeysTableOf<TVal>*  fHash;
00175 };
00176 
00177 
00178 
00179 XERCES_CPP_NAMESPACE_END
00180 
00181 #if !defined(XERCES_TMPLSINC)
00182 #include <xercesc/framework/psvi/XSNamedMap.c>
00183 #endif
00184 
00185 #endif