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