Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanDOMStringReusableAllocator.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(XALANDOMSTRINGREUSABLEALLOCATOR_INCLUDE_GUARD_12455133)
18 #define XALANDOMSTRINGREUSABLEALLOCATOR_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 ReusableArenaBlock<data_type> ArenaBlockType;
48 
50  ArenaBlockType> ArenaAllocatorType;
51 #else
53 #endif
54 
56 
57  enum { eDefaultBlockSize = 32 };
58 
59 
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 
136  /*
137  * Destroy a XalanDOMString object.
138  *
139  */
140  bool
141  destroy(XalanDOMString& theDOMString)
142  {
143  return m_allocator.destroyObject(&theDOMString);
144  }
145 
149  bool
150  ownsObject(const data_type* theObject)
151  {
152  return m_allocator.ownsObject(theObject);
153  }
154 
158  void
160  {
161  m_allocator.reset();
162  }
163 
169  size_type
171  {
172  return m_allocator.getBlockCount();
173  }
174 
181  size_type
182  getBlockSize() const
183  {
184  return m_allocator.getBlockSize();
185  }
186 
195  {
196  return m_allocator.getMemoryManager();
197  }
198 
205  const MemoryManagerType&
207  {
208  return m_allocator.getMemoryManager();
209  }
210 
211 private:
212 
213  // Not implemented...
215 
217  operator=(const XalanDOMStringReusableAllocator&);
218 
219  // Data members...
220  ArenaAllocatorType m_allocator;
221 };
222 
223 
224 
225 XALAN_CPP_NAMESPACE_END
226 
227 
228 
229 #endif // XALANDOMSTRINGREUSABLEALLOCATOR_INCLUDE_GUARD_12455133
ReusableArenaAllocator< data_type > ArenaAllocatorType
Definition: XalanDOMStringReusableAllocator.hpp:52
void reset()
Delete all instance objects from allocator.
Definition: XalanDOMStringReusableAllocator.hpp:159
size_type getBlockSize() const
Get size of an ArenaBlock, that is, the number of objects in each block.
Definition: XalanDOMStringReusableAllocator.hpp:182
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
MemoryManagerType & getMemoryManager()
Get a reference to the MemoryManagerType instance for this instance.
Definition: XalanDOMStringReusableAllocator.hpp:194
size_type getBlockCount() const
Get the number of ArenaBlocks currently allocated.
Definition: XalanDOMStringReusableAllocator.hpp:170
ArenaAllocatorType::size_type size_type
Definition: XalanDOMStringReusableAllocator.hpp:55
data_type::size_type data_type_size_type
Definition: XalanDOMStringReusableAllocator.hpp:44
XalanDOMString data_type
Definition: XalanDOMStringReusableAllocator.hpp:43
const MemoryManagerType & getMemoryManager() const
Get a reference to the MemoryManagerType instance for this instance.
Definition: XalanDOMStringReusableAllocator.hpp:206
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
Definition: XalanDOMStringReusableAllocator.hpp:39
bool ownsObject(const data_type *theObject)
Determine if an object is owned by the allocator...
Definition: XalanDOMStringReusableAllocator.hpp:150
bool destroy(XalanDOMString &theDOMString)
Definition: XalanDOMStringReusableAllocator.hpp:141
Definition: XalanDOMString.hpp:42
#define XALAN_PLATFORMSUPPORT_EXPORT
Definition: PlatformSupportDefinitions.hpp:33
unsigned int size_type
Definition: XalanDOMString.hpp:53

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