00001 /* 00002 * Copyright 1999-2004 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 #if !defined(XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680) 00017 #define XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680 00018 00019 00020 00021 // Base include file. Must be first. 00022 #include <xalanc/XPath/XPathDefinitions.hpp> 00023 00024 00025 00026 #include <xalanc/Include/XalanVector.hpp> 00027 00028 00029 00030 // Base class header file... 00031 #include <xalanc/XPath/XObjectFactory.hpp> 00032 00033 00034 00035 #include <xalanc/XPath/XBoolean.hpp> 00036 #include <xalanc/XPath/XNodeSetAllocator.hpp> 00037 #include <xalanc/XPath/XNodeSetNodeProxyAllocator.hpp> 00038 #include <xalanc/XPath/XNull.hpp> 00039 #include <xalanc/XPath/XNumberAllocator.hpp> 00040 #include <xalanc/XPath/XStringAllocator.hpp> 00041 #include <xalanc/XPath/XStringAdapterAllocator.hpp> 00042 #include <xalanc/XPath/XStringCachedAllocator.hpp> 00043 #include <xalanc/XPath/XStringReferenceAllocator.hpp> 00044 #include <xalanc/XPath/XTokenNumberAdapterAllocator.hpp> 00045 #include <xalanc/XPath/XTokenStringAdapterAllocator.hpp> 00046 00047 00048 00049 00050 XALAN_CPP_NAMESPACE_BEGIN 00051 00052 00053 00057 class XALAN_XPATH_EXPORT XObjectFactoryDefault : public XObjectFactory 00058 { 00059 public: 00060 00061 // Default block size for strings. 00062 enum 00063 { 00064 eDefaultXStringBlockSize = 10, 00065 eDefaultXNumberBlockSize = 10, 00066 eDefaultXNodeSetBlockSize = 10, 00067 eDefaultXNodeSetNodeProxyBlockSize = 5, 00068 eXNumberCacheMax = 40, 00069 eXNodeSetCacheMax = 40, 00070 eXStringCacheMax = 40, 00071 eXResultTreeFragCacheMax = 40 00072 }; 00073 00074 typedef XNodeSetAllocator::size_type size_type; 00075 00083 explicit 00084 XObjectFactoryDefault( 00085 MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR, 00086 size_type theXStringBlockSize = eDefaultXStringBlockSize, 00087 size_type theXNumberBlockSize = eDefaultXNumberBlockSize, 00088 size_type theXNodeSetBlockSize = eDefaultXNodeSetBlockSize, 00089 size_type theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize); 00090 00091 static XObjectFactoryDefault* 00092 create( 00093 MemoryManagerType& theManager, 00094 size_type theXStringBlockSize = eDefaultXStringBlockSize, 00095 size_type theXNumberBlockSize = eDefaultXNumberBlockSize, 00096 size_type theXNodeSetBlockSize = eDefaultXNodeSetBlockSize, 00097 size_type theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize); 00098 00099 00100 virtual 00101 ~XObjectFactoryDefault(); 00102 00103 MemoryManagerType& 00104 getMemoryManager() 00105 { 00106 return m_xobjects.getMemoryManager(); 00107 } 00108 // These methods are inherited from XObjectFactory ... 00109 00110 virtual void 00111 reset(); 00112 00113 virtual const XObjectPtr 00114 createBoolean(bool theValue); 00115 00116 virtual const XObjectPtr 00117 createNodeSet(BorrowReturnMutableNodeRefList& theValue); 00118 00119 virtual const XObjectPtr 00120 createNodeSet(XalanNode* theValue); 00121 00122 virtual const XObjectPtr 00123 createNull(); 00124 00125 virtual const XObjectPtr 00126 createNumber(double theValue); 00127 00128 virtual const XObjectPtr 00129 createNumber(const XToken& theValue); 00130 00131 virtual const XObjectPtr 00132 createString(const XalanDOMString& theValue); 00133 00134 virtual const XObjectPtr 00135 createString(const XalanDOMChar* theValue); 00136 00137 virtual const XObjectPtr 00138 createString( 00139 const XalanDOMChar* theValue, 00140 unsigned int theLength); 00141 00142 virtual const XObjectPtr 00143 createString(const XToken& theValue); 00144 00145 virtual const XObjectPtr 00146 createStringReference(const XalanDOMString& theValue); 00147 00148 virtual const XObjectPtr 00149 createStringAdapter(const XObjectPtr& theValue); 00150 00151 virtual const XObjectPtr 00152 createString(GetAndReleaseCachedString& theValue); 00153 00154 virtual const XObjectPtr 00155 createUnknown( 00156 const XalanDOMString& theValue); 00157 00158 typedef XalanVector<XObject*> XObjectCollectionType; 00159 typedef XalanVector<XNumber*> XNumberCacheType; 00160 typedef XalanVector<XNodeSet*> XNodeSetCacheType; 00161 typedef XalanVector<XString*> XStringCacheType; 00162 00163 protected: 00164 00165 virtual bool 00166 doReturnObject( 00167 XObject* theXObject, 00168 bool fInReset = false); 00169 00170 private: 00171 00172 // Not implemented... 00173 XObjectFactoryDefault(const XObjectFactoryDefault&); 00174 00175 XObjectFactoryDefault& 00176 operator=(const XObjectFactoryDefault&); 00177 00178 bool 00179 operator==(const XObjectFactoryDefault&) const; 00180 00181 00182 // Data members... 00183 00184 // This one's first, since it may be be holding references 00185 // to objects in other allocators. 00186 XStringAdapterAllocator m_xstringAdapterAllocator; 00187 00188 XStringAllocator m_xstringAllocator; 00189 00190 XStringCachedAllocator m_xstringCachedAllocator; 00191 00192 XStringReferenceAllocator m_xstringReferenceAllocator; 00193 00194 XNumberAllocator m_xnumberAllocator; 00195 00196 XNodeSetAllocator m_xnodesetAllocator; 00197 00198 XNodeSetNodeProxyAllocator m_xnodesetNodeProxyAllocator; 00199 00200 XTokenNumberAdapterAllocator m_xtokenNumberAdapterAllocator; 00201 00202 XTokenStringAdapterAllocator m_xtokenStringAdapterAllocator; 00203 00204 XObjectCollectionType m_xobjects; 00205 00206 XNumberCacheType m_xnumberCache; 00207 00208 XNodeSetCacheType m_xnodesetCache; 00209 00210 XStringCacheType m_xstringCache; 00211 00212 XNull m_xnull; 00213 00214 XBoolean m_xbooleanFalse; 00215 00216 XBoolean m_xbooleanTrue; 00217 }; 00218 00219 00220 00221 XALAN_CPP_NAMESPACE_END 00222 00223 00224 00225 #endif // XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.10 |
|