Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

XalanDOMStringPool.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #if !defined(XALANDOMSTRINGPOOL_HEADER_GUARD_1357924680)
00017 #define XALANDOMSTRINGPOOL_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
00023 
00024 
00025 
00026 #include <xalanc/PlatformSupport/ArenaAllocator.hpp>
00027 #include <xalanc/PlatformSupport/DOMStringHelper.hpp>
00028 #include <xalanc/PlatformSupport/XalanDOMStringAllocator.hpp>
00029 #include <xalanc/PlatformSupport/XalanDOMStringHashTable.hpp>
00030 
00031 
00032 
00033 XALAN_CPP_NAMESPACE_BEGIN
00034 
00035 
00036 
00037 class XALAN_PLATFORMSUPPORT_EXPORT XalanDOMStringPool
00038 {
00039 public:
00040 
00041     enum { eDefaultBlockSize = 32,
00042            eDefaultBucketCount = XalanDOMStringHashTable::eDefaultBucketCount,
00043            eDefaultBucketSize = XalanDOMStringHashTable::eDefaultBucketSize };
00044 
00045     typedef XalanDOMStringAllocator         AllocatorType;
00046 
00047     typedef AllocatorType::size_type                    block_size_type;
00048     typedef size_t                                      bucket_count_type;
00049     typedef XalanDOMStringHashTable::bucket_size_type   bucket_size_type;
00050 
00058     explicit
00059     XalanDOMStringPool(
00060             block_size_type     theBlockSize = eDefaultBlockSize,
00061             bucket_count_type   theBucketCount = eDefaultBucketCount,
00062             bucket_size_type    theBucketSize = eDefaultBucketSize);
00063 
00064     virtual
00065     ~XalanDOMStringPool();
00066 
00071     virtual void
00072     clear();
00073 
00079     virtual size_t
00080     size() const;
00081 
00088     virtual const XalanDOMString&
00089     get(const XalanDOMString&   theString);
00090 
00098     virtual const XalanDOMString&
00099     get(
00100             const XalanDOMChar*         theString,
00101             XalanDOMString::size_type   theLength = XalanDOMString::npos);
00102 
00109     const XalanDOMStringHashTable&
00110     getHashTable() const
00111     {
00112         return m_hashTable;
00113     }
00114 
00115 private:
00116 
00117     // Not implemented, for now...
00118     XalanDOMStringPool(const XalanDOMStringPool&);
00119 
00120     XalanDOMStringPool&
00121     operator=(const XalanDOMStringPool&);
00122 
00123     bool
00124     operator==(const XalanDOMStringPool&) const;
00125 
00126     // Data members...
00127     AllocatorType                   m_stringAllocator;
00128 
00129     size_t                          m_stringCount;
00130 
00131     XalanDOMStringHashTable         m_hashTable;
00132 
00133     static const XalanDOMString     s_emptyString;
00134 };
00135 
00136 
00137 
00138 XALAN_CPP_NAMESPACE_END
00139 
00140 
00141 
00142 #endif  // !defined(XALANDOMSTRINGPOOL_HEADER_GUARD_1357924680)

Interpreting class diagrams

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

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