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(XALANMATCHPATTERNDATAALLOCATOR_INCLUDE_GUARD_12455133) 00020 #define XALANMATCHPATTERNDATAALLOCATOR_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/XalanMatchPatternData.hpp" 00030 00031 00032 00033 #include "xalanc/PlatformSupport/ArenaAllocator.hpp" 00034 00035 00036 00037 XALAN_CPP_NAMESPACE_BEGIN 00038 00039 00040 00041 class XALAN_XSLT_EXPORT XalanMatchPatternDataAllocator 00042 { 00043 public: 00044 00045 typedef XalanMatchPatternData data_type; 00046 00047 #if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS) 00048 typedef ArenaBlock<data_type> ArenaBlockType; 00049 typedef ArenaAllocator<data_type, 00050 ArenaBlockType> ArenaAllocatorType; 00051 #else 00052 typedef ArenaAllocator<data_type> ArenaAllocatorType; 00053 #endif 00054 00055 typedef ArenaAllocatorType::size_type size_type; 00056 00057 /** 00058 * Construct an instance that will allocate blocks of the specified size. 00059 * 00060 * @param theBlockSize The block size. 00061 */ 00062 XalanMatchPatternDataAllocator(MemoryManager& theManager, size_type theBlockCount); 00063 00064 ~XalanMatchPatternDataAllocator(); 00065 00066 /** 00067 * Construct an instance 00068 * 00069 * @param constructionContext context for construction of object 00070 * @param stylesheetTree stylesheet containing element 00071 * @param atts list of attributes for element 00072 * @param lineNumber line number in document 00073 * @param columnNumber column number in document 00074 * 00075 * @param theTemplate The ElemTemplate node that contains the template for this pattern 00076 * @param thePosition The position in the stylesheet 00077 * @param theTargetString The target string for match pattern 00078 * @param TheMatchPattern The match pattern 00079 * @param thePatternString the pattern string 00080 * @param thePriority The priority for the match pattern. 00081 * 00082 * @return A pointer to the new instance. 00083 */ 00084 data_type* 00085 create( 00086 const ElemTemplate& theTemplate, 00087 data_type::size_type thePosition, 00088 const XalanDOMString& theTargetString, 00089 const XPath& theMatchPattern, 00090 const XalanDOMString& thePatternString, 00091 data_type::eMatchScore thePriority); 00092 00093 /** 00094 * Determine if an object is owned by the allocator... 00095 */ 00096 bool 00097 ownsObject(const data_type* theObject) 00098 { 00099 return m_allocator.ownsObject(theObject); 00100 } 00101 00102 /** 00103 * Delete all objects from the allocator. 00104 */ 00105 void 00106 reset() 00107 { 00108 m_allocator.reset(); 00109 } 00110 00111 /** 00112 * Get the number of ArenaBlocks currently allocated. 00113 * 00114 * @return The number of blocks. 00115 */ 00116 size_type 00117 getBlockCount() const 00118 { 00119 return m_allocator.getBlockCount(); 00120 } 00121 00122 /** 00123 * Get size of an ArenaBlock, that is, the number 00124 * of objects in each block. 00125 * 00126 * @return The size of the block 00127 */ 00128 size_type 00129 getBlockSize() const 00130 { 00131 return m_allocator.getBlockSize(); 00132 } 00133 00134 private: 00135 00136 // Not implemented... 00137 XalanMatchPatternDataAllocator(const XalanMatchPatternDataAllocator&); 00138 00139 XalanMatchPatternDataAllocator& 00140 operator=(const XalanMatchPatternDataAllocator&); 00141 00142 // Data members... 00143 ArenaAllocatorType m_allocator; 00144 }; 00145 00146 00147 00148 XALAN_CPP_NAMESPACE_END 00149 00150 00151 00152 #endif // XALANMATCHPATTERNDATAALLOCATOR_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 |
|