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(XERCESELEMENTBRIDGEALLOCATOR_INCLUDE_GUARD_12455133) 00020 #define XERCESELEMENTBRIDGEALLOCATOR_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/Deprecated/XercesElementBridge.hpp> 00033 00034 00035 00036 XALAN_CPP_NAMESPACE_BEGIN 00037 00038 00039 /** 00040 * This class is deprecated. 00041 * 00042 * @deprecated This class is part of the deprecated Xerces DOM bridge. 00043 */ 00044 class XALAN_XERCESPARSERLIAISON_EXPORT XercesElementBridgeAllocator 00045 { 00046 public: 00047 00048 typedef XercesElementBridge ObjectType; 00049 00050 00051 #if defined(XALAN_NO_DEFAULT_TEMPLATE_ARGUMENTS) 00052 typedef ArenaBlock<ObjectType> ArenaBlockType; 00053 00054 typedef ArenaAllocator<ObjectType, 00055 ArenaBlockType> ArenaAllocatorType; 00056 #else 00057 typedef ArenaAllocator<ObjectType> ArenaAllocatorType; 00058 #endif 00059 00060 typedef ArenaAllocatorType::size_type size_type; 00061 00062 /** 00063 * Construct an instance that will allocate blocks of the specified size. 00064 * 00065 * @param theBlockSize The block size. 00066 */ 00067 XercesElementBridgeAllocator(size_type theBlockCount); 00068 00069 ~XercesElementBridgeAllocator(); 00070 00071 /** 00072 * Create a XercesElementBridge instance. 00073 * 00074 * @param theXercesElement The Xerces element node 00075 * @param theNavigator The navigator for this instance. 00076 * 00077 * @return pointer to the instance 00078 */ 00079 ObjectType* 00080 create( 00081 const DOM_ElementType& theXercesElement, 00082 const XercesBridgeNavigator& theNavigator); 00083 00084 /** 00085 * Delete all objects from allocator. 00086 */ 00087 void 00088 reset(); 00089 00090 /** 00091 * Get size of an ArenaBlock, that is, the number 00092 * of objects in each block. 00093 * 00094 * @return The size of the block 00095 */ 00096 size_type 00097 getBlockCount() const 00098 { 00099 return m_allocator.getBlockCount(); 00100 } 00101 00102 /** 00103 * Get the number of ArenaBlocks currently allocated. 00104 * 00105 * @return The number of blocks. 00106 */ 00107 size_type 00108 getBlockSize() const 00109 { 00110 return m_allocator.getBlockSize(); 00111 } 00112 00113 00114 private: 00115 00116 // Not implemented... 00117 XercesElementBridgeAllocator(const XercesElementBridgeAllocator&); 00118 00119 XercesElementBridgeAllocator& 00120 operator=(const XercesElementBridgeAllocator&); 00121 00122 // Data members... 00123 ArenaAllocatorType m_allocator; 00124 }; 00125 00126 00127 00128 XALAN_CPP_NAMESPACE_END 00129 00130 00131 00132 #endif // XERCESELEMENTBRIDGEALLOCATOR_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 |
|