Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanDOMStringHashTable.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(XALANDOMSTRINGHASHTABLE_HEADER_GUARD_1357924680)
17 #define XALANDOMSTRINGHASHTABLE_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
30 
31 
32 
33 
35 
36 
37 
38 XALAN_CPP_NAMESPACE_BEGIN
39 
40 
41 
43 {
44 public:
45 
49 
50  enum { eDefaultBucketCount = 101, eDefaultBucketSize = 15 };
51 
52 
59  explicit
61  MemoryManagerType& theManager,
62  size_t theBucketCount = eDefaultBucketCount,
63  bucket_size_type theBucketSize = eDefaultBucketSize);
64 
66 
70  void
71  clear();
72 
78  size_t
79  size() const
80  {
81  return m_count;
82  }
83 
89  size_t
90  bucketCount() const
91  {
92  return m_bucketCount;
93  }
94 
100  void
101  getBucketCounts(BucketCountsType& theVector) const;
102 
109  size_t
110  collisions() const
111  {
112  return m_collisions;
113  }
114 
122  const XalanDOMString*
123  find(
124  const XalanDOMString& theString,
125  size_t* theBucketIndex = 0) const;
126 
139  const XalanDOMString*
140  find(
141  const XalanDOMChar* theString,
143  size_t* theBucketIndex = 0) const;
144 
157  void
158  insert(const XalanDOMString& theString);
159 
175  void
176  insert(
177  const XalanDOMString& theString,
178  size_t theBucketIndex);
179 
180 #if defined(XALAN_NEEDS_EXPLICIT_TEMPLATE_INSTANTIATION)
181  struct
182  equalsXalanDOMString
183  {
184  equalsXalanDOMString(
185  const XalanDOMChar* theString,
186  XalanDOMString::size_type theLength) :
187  m_string(theString),
188  m_length(theLength)
189  {
190  }
191 
192  bool
193  operator()(const XalanDOMString* theString) const;
194 
195  private:
196 
197  const XalanDOMChar* const m_string;
198 
199  const XalanDOMString::size_type m_length;
200  };
201 #endif
202 
205  {
206  assert(m_buckets.getMemoryManager() != 0);
207 
208  return *m_buckets.getMemoryManager();
209  }
210 
211  const MemoryManagerType&
213  {
214  assert(m_buckets.getMemoryManager() != 0);
215 
216  return *m_buckets.getMemoryManager();
217  }
218 
219 private:
220 
221  // Not implemented, for now...
223 
225  operator=(const XalanDOMStringHashTable&);
226 
227  bool
228  operator==(const XalanDOMStringHashTable&) const;
229 
230 
231  // Data members...
232  const size_t m_bucketCount;
233 
234  const bucket_size_type m_bucketSize;
235 
237 
238  size_t m_count;
239 
240  unsigned int m_collisions;
241 };
242 
243 
244 
245 XALAN_CPP_NAMESPACE_END
246 
247 
248 
249 #endif // !defined(XALANDOMSTRINGPOOL_HEADER_GUARD_1357924680)
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1111
size_t bucketCount() const
Get the number of buckets in the table.
Definition: XalanDOMStringHashTable.hpp:90
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
BucketType::size_type bucket_size_type
Definition: XalanDOMStringHashTable.hpp:47
Definition: XalanDOMStringHashTable.hpp:42
Definition: XalanMemMgrAutoPtr.hpp:219
size_t collisions() const
Get the collision count.
Definition: XalanDOMStringHashTable.hpp:110
~XalanDOMStringHashTable()
Definition: XalanDOMStringHashTable.hpp:65
void clear(XalanDOMString &theString)
Remove all elements from target string.
Definition: DOMStringHelper.hpp:2291
XalanVector< const XalanDOMString * > BucketType
Definition: XalanDOMStringHashTable.hpp:46
XalanVector< bucket_size_type > BucketCountsType
Definition: XalanDOMStringHashTable.hpp:48
const MemoryManagerType & getMemoryManager() const
Definition: XalanDOMStringHashTable.hpp:212
size_t size() const
Get the number of strings in the table.
Definition: XalanDOMStringHashTable.hpp:79
size_t size_type
Definition: XalanVector.hpp:71
MemoryManagerType & getMemoryManager()
Definition: XalanDOMStringHashTable.hpp:204
Definition: XalanDOMString.hpp:42
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:33
unsigned int size_type
Definition: XalanDOMString.hpp:53
XalanDOMString & insert(XalanDOMString &theString, XalanDOMString::size_type thePosition, const XalanDOMString &theStringToInsert)
Insert a string into another string.
Definition: DOMStringHelper.hpp:2241
Definition: XalanDOMString.hpp:63

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo