00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(SYNCHRONIZEDSTRINGPOOL_HPP)
00023 #define SYNCHRONIZEDSTRINGPOOL_HPP
00024
00025 #include <xercesc/framework/MemoryManager.hpp>
00026 #include <xercesc/util/StringPool.hpp>
00027 #include <xercesc/util/Mutexes.hpp>
00028
00029 XERCES_CPP_NAMESPACE_BEGIN
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class XMLSynchronizedStringPool : public XMLStringPool
00040 {
00041 public :
00042
00043
00044
00045 XMLSynchronizedStringPool
00046 (
00047 const XMLStringPool * constPool
00048 , const unsigned int modulus = 109
00049 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00050 );
00051 virtual ~XMLSynchronizedStringPool();
00052
00053
00054
00055
00056
00057 virtual unsigned int addOrFind(const XMLCh* const newString);
00058 virtual bool exists(const XMLCh* const newString) const;
00059 virtual bool exists(const unsigned int id) const;
00060 virtual void flushAll();
00061 virtual unsigned int getId(const XMLCh* const toFind) const;
00062 virtual const XMLCh* getValueForId(const unsigned int id) const;
00063 virtual unsigned int getStringCount() const;
00064
00065
00066 private :
00067
00068
00069
00070 XMLSynchronizedStringPool(const XMLSynchronizedStringPool&);
00071 XMLSynchronizedStringPool& operator=(const XMLSynchronizedStringPool&);
00072
00073
00074
00075
00076
00077
00078
00079
00080 const XMLStringPool* fConstPool;
00081 XMLMutex fMutex;
00082 };
00083
00084 XERCES_CPP_NAMESPACE_END
00085
00086 #endif