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(XERCESATTRWRAPPERALLOCATOR_INCLUDE_GUARD_12455133) 00020 #define XERCESATTRWRAPPERALLOCATOR_INCLUDE_GUARD_12455133 00021 00022 00023 00024 #include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp> 00025 00026 00027 00028 #include <xalanc/PlatformSupport/ArenaAllocator.hpp> 00029 00030 00031 00032 #include <xalanc/XercesParserLiaison/XercesAttrWrapper.hpp> 00033 00034 00035 00036 XALAN_CPP_NAMESPACE_BEGIN 00037 00038 00039 00040 class XALAN_XERCESPARSERLIAISON_EXPORT XercesAttrWrapperAllocator 00041 { 00042 public: 00043 00044 typedef XercesAttrWrapper ObjectType; 00045 00046 #if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS) 00047 typedef ArenaBlock<ObjectType> ArenaBlockType; 00048 00049 typedef ArenaAllocator<ObjectType, 00050 ArenaBlockType> ArenaAllocatorType; 00051 #else 00052 typedef ArenaAllocator<ObjectType> 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 XercesAttrWrapperAllocator(MemoryManager& theManager, size_type theBlockCount); 00063 00064 ~XercesAttrWrapperAllocator(); 00065 00066 /** 00067 * Create a XercesAttrWrapper instance. 00068 * 00069 * @param theXercesAttr The Xerces attribute node 00070 * @param theNavigator The navigator for this instance. 00071 * 00072 * @return pointer to the instance 00073 */ 00074 ObjectType* 00075 create( 00076 const DOMAttrType* theXercesAttr, 00077 const XercesWrapperNavigator& theNavigator); 00078 00079 /** 00080 * Delete all objects from allocator. 00081 */ 00082 void 00083 reset(); 00084 00085 /** 00086 * Get size of an ArenaBlock, that is, the number 00087 * of objects in each block. 00088 * 00089 * @return The size of the block 00090 */ 00091 size_type 00092 getBlockCount() const 00093 { 00094 return m_allocator.getBlockCount(); 00095 } 00096 00097 /** 00098 * Get the number of ArenaBlocks currently allocated. 00099 * 00100 * @return The number of blocks. 00101 */ 00102 size_type 00103 getBlockSize() const 00104 { 00105 return m_allocator.getBlockSize(); 00106 } 00107 00108 private: 00109 00110 // Not implemented... 00111 XercesAttrWrapperAllocator(const XercesAttrWrapperAllocator&); 00112 00113 XercesAttrWrapperAllocator& 00114 operator=(const XercesAttrWrapperAllocator&); 00115 00116 // Data members... 00117 ArenaAllocatorType m_allocator; 00118 }; 00119 00120 00121 00122 XALAN_CPP_NAMESPACE_END 00123 00124 00125 00126 #endif // XERCESATTRWRAPPERALLOCATOR_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 |
|