00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00019 #if !defined(XRESULTTREEFRAGALLOCATOR_INCLUDE_GUARD_12455133) 00020 #define XRESULTTREEFRAGALLOCATOR_INCLUDE_GUARD_12455133 00021 00022 00023 00024 // Base include file. Must be first. 00025 #include <xalanc/XSLT/XSLTDefinitions.hpp> 00026 00027 00028 00029 #include <xalanc/XSLT/XResultTreeFrag.hpp> 00030 00031 00032 00033 #include <xalanc/PlatformSupport/ReusableArenaAllocator.hpp> 00034 00035 00036 00037 XALAN_CPP_NAMESPACE_BEGIN 00038 00039 00040 00041 class XALAN_XSLT_EXPORT XResultTreeFragAllocator 00042 { 00043 public: 00044 00045 typedef XResultTreeFrag data_type; 00046 00047 typedef ReusableArenaAllocator<data_type> ArenaAllocatorType; 00048 typedef ArenaAllocatorType::size_type size_type; 00049 00050 /** 00051 * Construct an instance that will allocate blocks of the specified size. 00052 * 00053 * @param theBlockSize The block size. 00054 */ 00055 XResultTreeFragAllocator(MemoryManager& theManager, size_type theBlockCount); 00056 00057 ~XResultTreeFragAllocator(); 00058 00059 /** 00060 * Create an XResultTreeFrag object. 00061 * 00062 * @param theValue source value 00063 * 00064 * @return pointer to a node 00065 */ 00066 data_type* 00067 create(XalanDocumentFragment& theValue); 00068 00069 /** 00070 * Create an XResultTreeFrag object. 00071 * 00072 * @param theSource source XResultTreeFrag 00073 * 00074 * @return pointer to a node 00075 */ 00076 data_type* 00077 create(const data_type& theSource); 00078 00079 /** 00080 * Clone an XResultTreeFrag object. 00081 * 00082 * @param theSource source XResultTreeFrag 00083 * 00084 * @return pointer to an XResultTreeFrag 00085 */ 00086 data_type* 00087 clone(const XResultTreeFrag& theSource); 00088 00089 /** 00090 * Delete an XResultTreeFrag object from allocator. 00091 */ 00092 bool 00093 destroy(data_type* theObject); 00094 00095 /** 00096 * Determine if an object is owned by the allocator... 00097 */ 00098 bool 00099 ownsObject(const data_type* theObject) 00100 { 00101 return m_allocator.ownsObject(theObject); 00102 } 00103 00104 /** 00105 * Delete all XResultTreeFrag objects from allocator. 00106 */ 00107 void 00108 reset(); 00109 00110 /** 00111 * Get size of an ArenaBlock, that is, the number 00112 * of objects in each block. 00113 * 00114 * @return The size of the block 00115 */ 00116 size_type 00117 getBlockCount() const 00118 { 00119 return m_allocator.getBlockCount(); 00120 } 00121 00122 /** 00123 * Get the number of ArenaBlocks currently allocated. 00124 * 00125 * @return The number of blocks. 00126 */ 00127 size_type 00128 getBlockSize() const 00129 { 00130 return m_allocator.getBlockSize(); 00131 } 00132 00133 private: 00134 00135 // Not implemented... 00136 XResultTreeFragAllocator(const XResultTreeFragAllocator&); 00137 00138 XResultTreeFragAllocator& 00139 operator=(const XResultTreeFragAllocator&); 00140 00141 // Data members... 00142 ArenaAllocatorType m_allocator; 00143 }; 00144 00145 00146 00147 XALAN_CPP_NAMESPACE_END 00148 00149 00150 00151 #endif // XRESULTTREEFRAGALLOCATOR_INCLUDE_GUARD_12455133
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|