## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.9

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

# XalanSourceTreeDocumentAllocator.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
    00017 #if !defined(XALANSOURCETREEDOCUMENTALLOCATOR_INCLUDE_GUARD_12455133)
    00018 #define XALANSOURCETREEDOCUMENTALLOCATOR_INCLUDE_GUARD_12455133
    00019
    00020
    00021
    00022 // Base include file.  Must be first.
    00023 #include <xalanc/XSLT/XSLTDefinitions.hpp>
    00024
    00025
    00026
    00027 #include <xalanc/PlatformSupport/ReusableArenaAllocator.hpp>
    00028
    00029
    00030
    00031 #include <xalanc/XalanSourceTree/XalanSourceTreeDocument.hpp>
    00032
    00033
    00034
    00035 XALAN_CPP_NAMESPACE_BEGIN
    00036
    00037
    00038
    00039 class XALAN_XSLT_EXPORT XalanSourceTreeDocumentAllocator
    00040 {
    00041 public:
    00042
    00043     typedef XalanSourceTreeDocument             data_type;
    00044
    00045     typedef ReusableArenaAllocator<data_type>               ArenaAllocatorType;
    00046     typedef ArenaAllocatorType::size_type                   size_type;
    00047
    00048     enum { eDefaultAttributeAllocatorBlockSize = XalanSourceTreeDocument::eDefaultAttributeAllocatorBlockSize,
    00049            eDefaultAttributeNSAllocatorBlockSize = XalanSourceTreeDocument::eDefaultAttributeNSAllocatorBlockSize,
    00050            eDefaultCommentAllocatorBlockSize = XalanSourceTreeDocument::eDefaultCommentAllocatorBlockSize,
    00051            eDefaultElementAllocatorBlockSize = XalanSourceTreeDocument::eDefaultElementAllocatorBlockSize,
    00052            eDefaultElementNSAllocatorBlockSize = XalanSourceTreeDocument::eDefaultElementNSAllocatorBlockSize,
    00053            eDefaultPIAllocatorBlockSize = XalanSourceTreeDocument::eDefaultPIAllocatorBlockSize,
    00054            eDefaultTextAllocatorBlockSize = XalanSourceTreeDocument::eDefaultTextAllocatorBlockSize,
    00055            eDefaultTextIWSAllocatorBlockSize = XalanSourceTreeDocument::eDefaultTextIWSAllocatorBlockSize,
    00056            eDefaultNamesStringPoolBlockSize = XalanSourceTreeDocument::eDefaultNamesStringPoolBlockSize,
    00057            eDefaultNamesStringPoolBucketCount = XalanSourceTreeDocument::eDefaultNamesStringPoolBucketCount,
    00058            eDefaultNamesStringPoolBucketSize = XalanSourceTreeDocument::eDefaultNamesStringPoolBucketSize,
    00059            eDefaultValuesStringPoolBlockSize = XalanSourceTreeDocument::eDefaultValuesStringPoolBlockSize,
    00060            eDefaultValuesStringPoolBucketCount = XalanSourceTreeDocument::eDefaultValuesStringPoolBucketCount,
    00061            eDefaultValuesStringPoolBucketSize = XalanSourceTreeDocument::eDefaultValuesStringPoolBucketSize };
    00062
    00063     typedef XalanSourceTreeDocument::block_size_type    block_size_type;
    00064     typedef XalanSourceTreeDocument::bucket_count_type  bucket_count_type;
    00065     typedef XalanSourceTreeDocument::bucket_size_type   bucket_size_type;
    00066
    00072     XalanSourceTreeDocumentAllocator(MemoryManagerType&  theManager, size_type  theBlockCount);
    00073
    00074     ~XalanSourceTreeDocumentAllocator();
    00075
    00089     data_type*
    00090     create(
    00091             bool                fPoolAllText = true,
    00092             block_size_type     theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
    00093             bucket_count_type   theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
    00094             bucket_size_type    theNamesStringPoolBucketSize = eDefaultNamesStringPoolBucketSize,
    00095             block_size_type     theValuesStringPoolBlockSize = eDefaultValuesStringPoolBlockSize,
    00096             bucket_count_type   theValuesStringPoolBucketCount = eDefaultValuesStringPoolBucketCount,
    00097             bucket_size_type    theValuesStringPoolBucketSize = eDefaultValuesStringPoolBucketSize);
    00098
    00113     data_type*
    00114     create(
    00115             size_type   theAttributeBlockSize,
    00116             size_type   theAttributeNSBlockSize,
    00117             size_type   theCommentBlockSize,
    00118             size_type   theElementBlockSize,
    00119             size_type   theElementNSBlockSize,
    00120             size_type   thePIBlockSize,
    00121             size_type   theTextBlockSize,
    00122             size_type   theTextIWSBlockSize,
    00123             bool        fPoolAllText = true);
    00124
    00128     bool
    00129     destroy(data_type*  theObject);
    00130
    00134     bool
    00135     ownsObject(const data_type*     theObject)
    00136     {
    00137         return m_allocator.ownsObject(theObject);
    00138     }
    00139
    00143     void
    00144     reset();
    00145
    00151     size_type
    00152     getBlockCount() const
    00153     {
    00154         return m_allocator.getBlockCount();
    00155     }
    00156
    00163     size_type
    00164     getBlockSize() const
    00165     {
    00166         return m_allocator.getBlockSize();
    00167     }
    00168
    00169 private:
    00170
    00171     // Not implemented...
    00172     XalanSourceTreeDocumentAllocator(const XalanSourceTreeDocumentAllocator&);
    00173
    00174     XalanSourceTreeDocumentAllocator&
    00175     operator=(const XalanSourceTreeDocumentAllocator&);
    00176
    00177     // Data members...
    00178     ArenaAllocatorType  m_allocator;
    00179 };
    00180
    00181
    00182
    00183 XALAN_CPP_NAMESPACE_END
    00184
    00185
    00186
    00187 #endif  // XALANSOURCETREEDOCUMENTALLOCATOR_INCLUDE_GUARD_12455133

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.9 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.