Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanDOMStringAllocator.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 
17 #if !defined(XALANDOMSTRINGALLOCATOR_INCLUDE_GUARD_12455133)
18 #define XALANDOMSTRINGALLOCATOR_INCLUDE_GUARD_12455133
19 
20 
21 
22 // Base include file. Must be first.
24 
25 
26 
28 
29 
30 
32 
33 
34 
35 XALAN_CPP_NAMESPACE_BEGIN
36 
37 
38 
40 {
41 public:
42 
45 
46 #if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS)
47  typedef ArenaBlock<data_type> ArenaBlockType;
48 
49  typedef ArenaAllocator<data_type,
50  ArenaBlockType> ArenaAllocatorType;
51 #else
53 #endif
54 
56 
57  enum { eDefaultBlockSize = 32 };
58 
59 
65  XalanDOMStringAllocator(MemoryManagerType& theManager, size_type theBlockCount);
66 
68 
74  data_type*
75  create();
76 
85  data_type*
86  create(
87  const char* theString,
88 #if defined(_MSC_VER) && (_MSC_VER <= 1300)
89  // $$$ ToDo: Some strange bug in MSVC++ complains when using data_type::npos here.
90  data_type_size_type theCount = data_type_size_type(-1));
91 #else
92  data_type_size_type theCount = data_type_size_type(data_type::npos));
93 #endif
94 
104  data_type*
105  create(
106  const data_type& theSource,
107  data_type_size_type theStartPosition = 0,
108  data_type_size_type theCount = data_type_size_type(data_type::npos));
109 
118  data_type*
119  create(
120  const XalanDOMChar* theString,
121  data_type_size_type theCount = data_type_size_type(data_type::npos));
122 
131  data_type*
132  create(
133  data_type_size_type theCount,
134  XalanDOMChar theChar);
135 
139  bool
140  ownsObject(const data_type* theObject)
141  {
142  return m_allocator.ownsObject(theObject);
143  }
144 
148  void
150  {
151  m_allocator.reset();
152  }
153 
159  size_type
161  {
162  return m_allocator.getBlockCount();
163  }
164 
171  size_type
172  getBlockSize() const
173  {
174  return m_allocator.getBlockSize();
175  }
176 
185  {
186  return m_allocator.getMemoryManager();
187  }
188 
195  const MemoryManagerType&
197  {
198  return m_allocator.getMemoryManager();
199  }
200 
201 private:
202 
203  // Not implemented...
205 
207  operator=(const XalanDOMStringAllocator&);
208 
209  // Data members...
210  ArenaAllocatorType m_allocator;
211 };
212 
213 
214 
215 XALAN_CPP_NAMESPACE_END
216 
217 
218 
219 #endif // XALANDOMSTRINGALLOCATOR_INCLUDE_GUARD_12455133
size_type getBlockCount() const
Get the number of ArenaBlocks currently allocated.
Definition: XalanDOMStringAllocator.hpp:160
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Definition: ArenaBlock.hpp:36
size_type getBlockSize() const
Get size of an ArenaBlock, that is, the number of objects in each block.
Definition: XalanDOMStringAllocator.hpp:172
Definition: ArenaAllocator.hpp:45
const MemoryManagerType & getMemoryManager() const
Get a reference to the MemoryManagerType instance for this instance.
Definition: XalanDOMStringAllocator.hpp:196
void reset()
Delete all instance objects from allocator.
Definition: XalanDOMStringAllocator.hpp:149
data_type::size_type data_type_size_type
Definition: XalanDOMStringAllocator.hpp:44
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
Definition: XalanDOMStringAllocator.hpp:39
MemoryManagerType & getMemoryManager()
Get a reference to the MemoryManagerType instance for this instance.
Definition: XalanDOMStringAllocator.hpp:184
ArenaAllocatorType::size_type size_type
Definition: XalanDOMStringAllocator.hpp:55
Definition: XalanDOMString.hpp:42
XalanDOMString data_type
Definition: XalanDOMStringAllocator.hpp:43
bool ownsObject(const data_type *theObject)
Determine if an object is owned by the allocator...
Definition: XalanDOMStringAllocator.hpp:140
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:33
unsigned int size_type
Definition: XalanDOMString.hpp:53
ArenaBlockType::size_type size_type
Definition: ArenaAllocator.hpp:53
ArenaAllocator< data_type > ArenaAllocatorType
Definition: XalanDOMStringAllocator.hpp:52

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