Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanSourceTreeDocumentAllocator.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #if !defined(XALANSOURCETREEDOCUMENTALLOCATOR_INCLUDE_GUARD_12455133)
20 #define XALANSOURCETREEDOCUMENTALLOCATOR_INCLUDE_GUARD_12455133
21 
22 
23 
24 // Base include file. Must be first.
26 
27 
28 
30 
31 
32 
34 
35 
36 
37 XALAN_CPP_NAMESPACE_BEGIN
38 
39 
40 
42 {
43 public:
44 
46 
49 
50  enum { eDefaultAttributeAllocatorBlockSize = XalanSourceTreeDocument::eDefaultAttributeAllocatorBlockSize,
51  eDefaultAttributeNSAllocatorBlockSize = XalanSourceTreeDocument::eDefaultAttributeNSAllocatorBlockSize,
54  eDefaultElementNSAllocatorBlockSize = XalanSourceTreeDocument::eDefaultElementNSAllocatorBlockSize,
62  eDefaultValuesStringPoolBucketCount = XalanSourceTreeDocument::eDefaultValuesStringPoolBucketCount,
63  eDefaultValuesStringPoolBucketSize = XalanSourceTreeDocument::eDefaultValuesStringPoolBucketSize };
64 
68 
69  /**
70  * Construct an instance that will allocate blocks of the specified size.
71  *
72  * @param theBlockSize The block size.
73  */
74  XalanSourceTreeDocumentAllocator(MemoryManager& theManager, size_type theBlockCount);
75 
77 
78  /**
79  * Create a XalanSourceTreeDocument object.
80  *
81  * @param fPoolAllText If false, text node data that is not whitespace will not be pooled.
82  * @param theNamesStringPoolBlockSize The block size for allocating strings in the name pool
83  * @param theNamesStringPoolBucketCount The number of buckets for allocating strings in the name pool
84  * @param theNamesStringPoolBucketSize The bucket size for allocating strings in the name pool
85  * @param theValuesStringPoolBlockSize The block size for allocating strings in the values pool
86  * @param theValuesStringPoolBucketCount The number of buckets for allocating strings in the values pool
87  * @param theValuesStringPoolBucketSize The bucket size for allocating strings in the values pool
88  *
89  * @return pointer to a node
90  */
91  data_type*
93  bool fPoolAllText = true,
94  block_size_type theNamesStringPoolBlockSize = eDefaultNamesStringPoolBlockSize,
95  bucket_count_type theNamesStringPoolBucketCount = eDefaultNamesStringPoolBucketCount,
96  bucket_size_type theNamesStringPoolBucketSize = eDefaultNamesStringPoolBucketSize,
97  block_size_type theValuesStringPoolBlockSize = eDefaultValuesStringPoolBlockSize,
98  bucket_count_type theValuesStringPoolBucketCount = eDefaultValuesStringPoolBucketCount,
99  bucket_size_type theValuesStringPoolBucketSize = eDefaultValuesStringPoolBucketSize);
100 
101  /**
102  * Create a XalanSourceTreeDocument object.
103  *
104  * @param fPoolAllText If false, text node data that is not whitespace will not be pooled.
105  * @param theAttributeBlockSize The block size for allocating attribute nodes
106  * @param theAttributeNSBlockSize The block size for allocating attribute NS nodes
107  * @param theCommentBlockSize The block size for allocating comment nodes
108  * @param theElementBlockSize The block size for allocating element nodes
109  * @param theElementNSBlockSize The block size for allocating element nodes
110  * @param theTextBlockSize The block size for allocating text nodes,
111  * @param theTextIWSBlockSize The block size for allocating text IWS nodes,
112  *
113  * @return pointer to a node
114  */
115  data_type*
117  size_type theAttributeBlockSize,
118  size_type theAttributeNSBlockSize,
119  size_type theCommentBlockSize,
120  size_type theElementBlockSize,
121  size_type theElementNSBlockSize,
122  size_type thePIBlockSize,
123  size_type theTextBlockSize,
124  size_type theTextIWSBlockSize,
125  bool fPoolAllText = true);
126 
127  /**
128  * Delete a XalanSourceTreeDocument object from allocator.
129  */
130  bool
131  destroy(data_type* theObject);
132 
133  /**
134  * Determine if an object is owned by the allocator...
135  */
136  bool
137  ownsObject(const data_type* theObject)
138  {
139  return m_allocator.ownsObject(theObject);
140  }
141 
142  /**
143  * Delete all XalanSourceTreeDocument objects from allocator.
144  */
145  void
146  reset();
147 
148  /**
149  * Get the number of ArenaBlocks currently allocated.
150  *
151  * @return The number of blocks.
152  */
153  size_type
155  {
156  return m_allocator.getBlockCount();
157  }
158 
159  /**
160  * Get size of an ArenaBlock, that is, the number
161  * of objects in each block.
162  *
163  * @return The size of the block
164  */
165  size_type
166  getBlockSize() const
167  {
168  return m_allocator.getBlockSize();
169  }
170 
171 private:
172 
173  // Not implemented...
175 
177  operator=(const XalanSourceTreeDocumentAllocator&);
178 
179  // Data members...
180  ArenaAllocatorType m_allocator;
181 };
182 
183 
184 
185 XALAN_CPP_NAMESPACE_END
186 
187 
188 
189 #endif // XALANSOURCETREEDOCUMENTALLOCATOR_INCLUDE_GUARD_12455133
ReusableArenaAllocator.hpp
XalanSourceTreeDocument::eDefaultAttributeAllocatorBlockSize
@ eDefaultAttributeAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:103
XalanSourceTreeDocumentAllocator::size_type
ArenaAllocatorType::size_type size_type
Definition: XalanSourceTreeDocumentAllocator.hpp:48
XalanSourceTreeDocument::eDefaultCommentAllocatorBlockSize
@ eDefaultCommentAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:105
XalanSourceTreeDocumentAllocator::create
data_type * create(bool fPoolAllText=true, block_size_type theNamesStringPoolBlockSize=eDefaultNamesStringPoolBlockSize, bucket_count_type theNamesStringPoolBucketCount=eDefaultNamesStringPoolBucketCount, bucket_size_type theNamesStringPoolBucketSize=eDefaultNamesStringPoolBucketSize, block_size_type theValuesStringPoolBlockSize=eDefaultValuesStringPoolBlockSize, bucket_count_type theValuesStringPoolBucketCount=eDefaultValuesStringPoolBucketCount, bucket_size_type theValuesStringPoolBucketSize=eDefaultValuesStringPoolBucketSize)
Create a XalanSourceTreeDocument object.
XalanSourceTreeDocument::eDefaultValuesStringPoolBucketCount
@ eDefaultValuesStringPoolBucketCount
Definition: XalanSourceTreeDocument.hpp:115
XalanSourceTreeDocumentAllocator::bucket_size_type
XalanSourceTreeDocument::bucket_size_type bucket_size_type
Definition: XalanSourceTreeDocumentAllocator.hpp:67
XalanSourceTreeDocumentAllocator::bucket_count_type
XalanSourceTreeDocument::bucket_count_type bucket_count_type
Definition: XalanSourceTreeDocumentAllocator.hpp:66
XalanSourceTreeDocument::eDefaultElementAllocatorBlockSize
@ eDefaultElementAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:106
XalanSourceTreeDocumentAllocator::~XalanSourceTreeDocumentAllocator
~XalanSourceTreeDocumentAllocator()
XalanSourceTreeDocument.hpp
ReusableArenaAllocator< data_type >
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
XalanSourceTreeDocument::block_size_type
XalanDOMStringPool::block_size_type block_size_type
Definition: XalanSourceTreeDocument.hpp:120
XalanSourceTreeDocumentAllocator::data_type
XalanSourceTreeDocument data_type
Definition: XalanSourceTreeDocumentAllocator.hpp:45
XalanSourceTreeDocument::eDefaultTextIWSAllocatorBlockSize
@ eDefaultTextIWSAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:110
XalanSourceTreeDocumentAllocator::getBlockCount
size_type getBlockCount() const
Get the number of ArenaBlocks currently allocated.
Definition: XalanSourceTreeDocumentAllocator.hpp:154
XalanSourceTreeDocument::bucket_size_type
XalanDOMStringPool::bucket_size_type bucket_size_type
Definition: XalanSourceTreeDocument.hpp:122
XalanSourceTreeDocument::bucket_count_type
XalanDOMStringPool::bucket_count_type bucket_count_type
Definition: XalanSourceTreeDocument.hpp:121
XalanSourceTreeDocumentAllocator::reset
void reset()
Delete all XalanSourceTreeDocument objects from allocator.
XalanSourceTreeDocumentAllocator::XalanSourceTreeDocumentAllocator
XalanSourceTreeDocumentAllocator(MemoryManager &theManager, size_type theBlockCount)
Construct an instance that will allocate blocks of the specified size.
XalanSourceTreeDocument
Definition: XalanSourceTreeDocument.hpp:76
XalanSourceTreeDocument::eDefaultValuesStringPoolBlockSize
@ eDefaultValuesStringPoolBlockSize
Definition: XalanSourceTreeDocument.hpp:114
XalanSourceTreeDocumentAllocator::ArenaAllocatorType
ReusableArenaAllocator< data_type > ArenaAllocatorType
Definition: XalanSourceTreeDocumentAllocator.hpp:47
XalanSourceTreeDocument::eDefaultPIAllocatorBlockSize
@ eDefaultPIAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:108
size_type
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:46
XalanSourceTreeDocumentAllocator::block_size_type
XalanSourceTreeDocument::block_size_type block_size_type
Definition: XalanSourceTreeDocumentAllocator.hpp:65
XalanSourceTreeDocumentAllocator::destroy
bool destroy(data_type *theObject)
Delete a XalanSourceTreeDocument object from allocator.
XalanSourceTreeDocument::eDefaultValuesStringPoolBucketSize
@ eDefaultValuesStringPoolBucketSize
Definition: XalanSourceTreeDocument.hpp:116
XSLTDefinitions.hpp
XalanSourceTreeDocument::eDefaultNamesStringPoolBlockSize
@ eDefaultNamesStringPoolBlockSize
Definition: XalanSourceTreeDocument.hpp:111
XalanSourceTreeDocument::eDefaultNamesStringPoolBucketSize
@ eDefaultNamesStringPoolBucketSize
Definition: XalanSourceTreeDocument.hpp:113
XalanSourceTreeDocument::eDefaultTextAllocatorBlockSize
@ eDefaultTextAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:109
XalanSourceTreeDocument::eDefaultElementNSAllocatorBlockSize
@ eDefaultElementNSAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:107
XalanSourceTreeDocument::eDefaultAttributeNSAllocatorBlockSize
@ eDefaultAttributeNSAllocatorBlockSize
Definition: XalanSourceTreeDocument.hpp:104
ReusableArenaAllocator< data_type >::size_type
ReusableArenaBlockType::size_type size_type
Definition: ReusableArenaAllocator.hpp:45
XalanSourceTreeDocumentAllocator
Definition: XalanSourceTreeDocumentAllocator.hpp:42
XalanSourceTreeDocumentAllocator::create
data_type * create(size_type theAttributeBlockSize, size_type theAttributeNSBlockSize, size_type theCommentBlockSize, size_type theElementBlockSize, size_type theElementNSBlockSize, size_type thePIBlockSize, size_type theTextBlockSize, size_type theTextIWSBlockSize, bool fPoolAllText=true)
Create a XalanSourceTreeDocument object.
XalanSourceTreeDocumentAllocator::ownsObject
bool ownsObject(const data_type *theObject)
Determine if an object is owned by the allocator...
Definition: XalanSourceTreeDocumentAllocator.hpp:137
XalanSourceTreeDocument::eDefaultNamesStringPoolBucketCount
@ eDefaultNamesStringPoolBucketCount
Definition: XalanSourceTreeDocument.hpp:112
XalanSourceTreeDocumentAllocator::getBlockSize
size_type getBlockSize() const
Get size of an ArenaBlock, that is, the number of objects in each block.
Definition: XalanSourceTreeDocumentAllocator.hpp:166

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

Apache Logo