00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999 The Apache Software Foundation. All rights 00006 * reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. The end-user documentation included with the redistribution, 00021 * if any, must include the following acknowledgment: 00022 * "This product includes software developed by the 00023 * Apache Software Foundation (http://www.apache.org/)." 00024 * Alternately, this acknowledgment may appear in the software itself, 00025 * if and wherever such third-party acknowledgments normally appear. 00026 * 00027 * 4. The names "Xalan" and "Apache Software Foundation" must 00028 * not be used to endorse or promote products derived from this 00029 * software without prior written permission. For written 00030 * permission, please contact apache@apache.org. 00031 * 00032 * 5. Products derived from this software may not be called "Apache", 00033 * nor may "Apache" appear in their name, without prior written 00034 * permission of the Apache Software Foundation. 00035 * 00036 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00038 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00039 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00040 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00041 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00042 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00043 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00045 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00046 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00047 * SUCH DAMAGE. 00048 * ==================================================================== 00049 * 00050 * This software consists of voluntary contributions made by many 00051 * individuals on behalf of the Apache Software Foundation and was 00052 * originally based on software copyright (c) 1999, International 00053 * Business Machines, Inc., http://www.ibm.com. For more 00054 * information on the Apache Software Foundation, please see 00055 * <http://www.apache.org/>. 00056 */ 00057 #if !defined(XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680) 00058 #define XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680 00059 00060 00061 00062 // Base include file. Must be first. 00063 #include <XPath/XPathDefinitions.hpp> 00064 00065 00066 00067 #include <set> 00068 00069 00070 00071 // Base class header file... 00072 #include <XPath/XObjectFactory.hpp> 00073 00074 00075 00076 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION) 00077 #include <XPath/XNull.hpp> 00078 #endif 00079 00080 00081 00082 #include <PlatformSupport/XalanAutoPtr.hpp> 00083 00084 00085 00086 class XNull; 00087 00088 00089 00093 class XALAN_XPATH_EXPORT XObjectFactoryDefault : public XObjectFactory 00094 { 00095 public: 00096 00100 explicit 00101 XObjectFactoryDefault(); 00102 00103 virtual 00104 ~XObjectFactoryDefault(); 00105 00106 00107 // These methods are inherited from XObjectFactory ... 00108 00109 virtual void 00110 reset(); 00111 00112 virtual XObject* 00113 clone(const XObject& theXObject); 00114 00115 virtual XObject* 00116 createBoolean( 00117 bool theValue, 00118 bool fOptimize = true); 00119 00120 virtual XObject* 00121 createNodeSet( 00122 BorrowReturnMutableNodeRefList& theValue, 00123 bool fOptimize = true); 00124 00125 virtual XObject* 00126 createNull(bool fOptimize = true); 00127 00128 virtual XObject* 00129 createNumber( 00130 double theValue, 00131 bool fOptimize = true); 00132 00133 virtual XObject* 00134 createString( 00135 const XalanDOMString& theValue, 00136 bool fOptimize = true); 00137 00138 virtual XObject* 00139 createUnknown( 00140 const XalanDOMString& theValue, 00141 bool fOptimize = true); 00142 00143 virtual XObject* 00144 createResultTreeFrag( 00145 ResultTreeFragBase* theValue, 00146 bool fOptimize = true); 00147 00148 virtual XObject* 00149 createSpan( 00150 BorrowReturnMutableNodeRefList& theValue, 00151 bool fOptimize = true); 00152 00153 #if defined(XALAN_NO_NAMESPACES) 00154 typedef set<const XObject*, less<const XObject*> > CollectionType; 00155 #else 00156 typedef std::set<const XObject*> CollectionType; 00157 #endif 00158 00164 CollectionType::size_type 00165 instanceCount() const 00166 { 00167 return m_xobjects.size(); 00168 } 00169 00170 #if !defined(NDEBUG) 00171 00172 unsigned long 00173 getTotalBooleanInstanceCount() const 00174 { 00175 return m_totalBooleanInstanceCount; 00176 } 00177 00178 unsigned long 00179 getTotalNodeSetInstanceCount() const 00180 { 00181 return m_totalNodeSetInstanceCount; 00182 } 00183 00184 unsigned long 00185 getTotalNullInstanceCount() const 00186 { 00187 return m_totalNullInstanceCount; 00188 } 00189 00190 unsigned long 00191 getTotalNumberInstanceCount() const 00192 { 00193 return m_totalNumberInstanceCount; 00194 } 00195 00196 unsigned long 00197 getTotalStringInstanceCount() const 00198 { 00199 return m_totalStringInstanceCount; 00200 } 00201 00202 unsigned long 00203 getTotalUnknownInstanceCount() const 00204 { 00205 return m_totalUnknownInstanceCount; 00206 } 00207 00208 unsigned long 00209 getTotalResultTreeFragInstanceCount() const 00210 { 00211 return m_totalResultTreeFragInstanceCount; 00212 } 00213 00214 unsigned long 00215 getTotalSpanInstanceCount() const 00216 { 00217 return m_totalSpanInstanceCount; 00218 } 00219 00220 #endif 00221 00222 protected: 00223 00224 // These methods are inherited from Factory ... 00225 00226 virtual bool 00227 doReturnObject( 00228 const XObject* theXObject, 00229 bool fInReset = false); 00230 00231 private: 00232 00233 // Not implemented... 00234 XObjectFactoryDefault(const XObjectFactoryDefault&); 00235 00236 XObjectFactoryDefault& 00237 operator=(const XObjectFactoryDefault&); 00238 00239 bool 00240 operator==(const XObjectFactoryDefault&) const; 00241 00242 00243 // Data members... 00244 CollectionType m_xobjects; 00245 00246 const XalanAutoPtr<XNull> m_XNull; 00247 00248 #if !defined(NDEBUG) 00249 00250 unsigned long m_totalBooleanInstanceCount; 00251 00252 unsigned long m_totalNodeSetInstanceCount; 00253 00254 unsigned long m_totalNullInstanceCount; 00255 00256 unsigned long m_totalNumberInstanceCount; 00257 00258 unsigned long m_totalStringInstanceCount; 00259 00260 unsigned long m_totalUnknownInstanceCount; 00261 00262 unsigned long m_totalResultTreeFragInstanceCount; 00263 00264 unsigned long m_totalSpanInstanceCount; 00265 00266 #endif 00267 }; 00268 00269 00270 00271 #endif // XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSL Transformer Version 1.0 |
|