neilg       2003/10/09 06:49:30

  Modified:    c/src/xercesc/util StringPool.cpp StringPool.hpp
  Log:
  make StringPool functions virtual so that we can implement a synchronized version of 
StringPool for thread-safe updates.
  
  Revision  Changes    Path
  1.6       +8 -1      xml-xerces/c/src/xercesc/util/StringPool.cpp
  
  Index: StringPool.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/StringPool.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StringPool.cpp    18 May 2003 14:02:05 -0000      1.5
  +++ StringPool.cpp    9 Oct 2003 13:49:30 -0000       1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/10/09 13:49:30  neilg
  + * make StringPool functions virtual so that we can implement a synchronized 
version of StringPool for thread-safe updates.
  + *
    * Revision 1.5  2003/05/18 14:02:05  knoaman
    * Memory manager implementation: pass per instance manager.
    *
  @@ -220,6 +223,10 @@
       return fIdMap[id]->fString;
   }
   
  +unsigned int XMLStringPool::getStringCount() const
  +{
  +    return fCurId-1;
  +}
   
   // ---------------------------------------------------------------------------
   //  XMLStringPool: Private helper methods
  
  
  
  1.6       +17 -10    xml-xerces/c/src/xercesc/util/StringPool.hpp
  
  Index: StringPool.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/StringPool.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- StringPool.hpp    16 May 2003 06:01:52 -0000      1.5
  +++ StringPool.hpp    9 Oct 2003 13:49:30 -0000       1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/10/09 13:49:30  neilg
  + * make StringPool functions virtual so that we can implement a synchronized 
version of StringPool for thread-safe updates.
  + *
    * Revision 1.5  2003/05/16 06:01:52  knoaman
    * Partial implementation of the configurable memory manager.
    *
  @@ -122,18 +125,19 @@
             const unsigned int   modulus = 109
           , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
       );
  -    ~XMLStringPool();
  +    virtual ~XMLStringPool();
   
   
       // -----------------------------------------------------------------------
       //  Pool management methods
       // -----------------------------------------------------------------------
  -    unsigned int addOrFind(const XMLCh* const newString);
  -    bool exists(const XMLCh* const newString) const;
  -    bool exists(const unsigned int id) const;
  -    void flushAll();
  -    unsigned int getId(const XMLCh* const toFind) const;
  -    const XMLCh* getValueForId(const unsigned int id) const;
  +    virtual unsigned int addOrFind(const XMLCh* const newString);
  +    virtual bool exists(const XMLCh* const newString) const;
  +    virtual bool exists(const unsigned int id) const;
  +    virtual void flushAll();
  +    virtual unsigned int getId(const XMLCh* const toFind) const;
  +    virtual const XMLCh* getValueForId(const unsigned int id) const;
  +    virtual unsigned int getStringCount() const;
   
   
   private :
  @@ -186,14 +190,17 @@
       //      The current capacity of the id map. When the current id hits this
       //      value the map must must be expanded.
       //
  -    //  fCurId
  -    //      This is the counter used to assign unique ids. It is just bumped
  -    //      up one for each new string added.
       // -----------------------------------------------------------------------
       MemoryManager*              fMemoryManager;
       PoolElem**                  fIdMap;
       RefHashTableOf<PoolElem>*   fHashTable;
       unsigned int                fMapCapacity;
  +
  +protected:
  +    // protected data members
  +    //  fCurId
  +    //      This is the counter used to assign unique ids. It is just bumped
  +    //      up one for each new string added.
       unsigned int                fCurId;
   };
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to