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*
92  create(
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*
116  create(
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
ReusableArenaBlockType::size_type size_type
XalanSourceTreeDocument::bucket_count_type bucket_count_type
ReusableArenaAllocator< data_type > ArenaAllocatorType
XalanSourceTreeDocument::bucket_size_type bucket_size_type
size_type getBlockSize() const
Get size of an ArenaBlock, that is, the number of objects in each block.
size_type getBlockCount() const
Get the number of ArenaBlocks currently allocated.
XalanDOMStringPool::block_size_type block_size_type
XalanDOMStringPool::bucket_size_type bucket_size_type
XalanDOMStringPool::bucket_count_type bucket_count_type
#define XALAN_XSLT_EXPORT
XalanSourceTreeDocument::block_size_type block_size_type
bool ownsObject(const data_type *theObject)
Determine if an object is owned by the allocator...

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