Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

XObjectFactoryDefault.hpp

Go to the documentation of this file.
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 <set>
00027 #include <vector>
00028 
00029 
00030 
00031 // Base class header file...
00032 #include <xalanc/XPath/XObjectFactory.hpp>
00033 
00034 
00035 
00036 #include <xalanc/XPath/XNodeSetAllocator.hpp>
00037 #include <xalanc/XPath/XNodeSetNodeProxyAllocator.hpp>
00038 #include <xalanc/XPath/XNumberAllocator.hpp>
00039 #include <xalanc/XPath/XStringAllocator.hpp>
00040 #include <xalanc/XPath/XStringAdapterAllocator.hpp>
00041 #include <xalanc/XPath/XStringCachedAllocator.hpp>
00042 #include <xalanc/XPath/XStringReferenceAllocator.hpp>
00043 #include <xalanc/XPath/XTokenNumberAdapterAllocator.hpp>
00044 #include <xalanc/XPath/XTokenStringAdapterAllocator.hpp>
00045 
00046 
00047 
00048 #if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION)
00049 #include <xalanc/XPath/XNull.hpp>
00050 #include <xalanc/XPath/XBoolean.hpp>
00051 #endif
00052 
00053 
00054 
00055 #include <xalanc/Include/XalanAutoPtr.hpp>
00056 
00057 
00058 
00059 XALAN_CPP_NAMESPACE_BEGIN
00060 
00061 
00062 
00063 class XBoolean;
00064 class XNull;
00065 class XNumber;
00066 
00067 
00068 
00072 class XALAN_XPATH_EXPORT XObjectFactoryDefault : public XObjectFactory
00073 {
00074 public:
00075 
00076     // Default block size for strings.
00077     enum
00078     {
00079         eDefaultXStringBlockSize = 10,
00080         eDefaultXNumberBlockSize = 10,
00081         eDefaultXNodeSetBlockSize = 10,
00082         eDefaultXNodeSetNodeProxyBlockSize = 5,
00083         eXNumberCacheMax = 40,
00084         eXNodeSetCacheMax = 40,
00085         eXStringCacheMax = 40,
00086         eXResultTreeFragCacheMax = 40
00087     };
00088 
00089     typedef unsigned long   size_type;
00090 
00098     explicit
00099     XObjectFactoryDefault(
00100             size_type   theXStringBlockSize = eDefaultXStringBlockSize,
00101             size_type   theXNumberBlockSize = eDefaultXNumberBlockSize,
00102             size_type   theXNodeSetBlockSize = eDefaultXNodeSetBlockSize,
00103             size_type   theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize); 
00104 
00105     virtual
00106     ~XObjectFactoryDefault();
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 #if defined(XALAN_NO_STD_NAMESPACE)
00159     typedef vector<XObject*>        XObjectCollectionType;
00160     typedef vector<XNumber*>        XNumberCacheType;
00161     typedef vector<XNodeSet*>       XNodeSetCacheType;
00162     typedef vector<XString*>        XStringCacheType;
00163 #else
00164     typedef std::vector<XObject*>   XObjectCollectionType;
00165     typedef std::vector<XNumber*>   XNumberCacheType;
00166     typedef std::vector<XNodeSet*>  XNodeSetCacheType;
00167     typedef std::vector<XString*>   XStringCacheType;
00168 #endif
00169 
00170 protected:
00171 
00172     virtual bool
00173     doReturnObject(
00174             XObject*    theXObject,
00175             bool        fInReset = false);
00176 
00177 private:
00178 
00179     // Not implemented...
00180     XObjectFactoryDefault(const XObjectFactoryDefault&);
00181 
00182     XObjectFactoryDefault&
00183     operator=(const XObjectFactoryDefault&);
00184 
00185     bool
00186     operator==(const XObjectFactoryDefault&) const;
00187 
00188 
00189     // Data members...
00190 
00191     // This one's first, since it may be be holding references
00192     // to objects in other allocators.
00193     XStringAdapterAllocator         m_xstringAdapterAllocator;
00194 
00195     XStringAllocator                m_xstringAllocator;
00196 
00197     XStringCachedAllocator          m_xstringCachedAllocator;
00198 
00199     XStringReferenceAllocator       m_xstringReferenceAllocator;
00200 
00201     XNumberAllocator                m_xnumberAllocator;
00202 
00203     XNodeSetAllocator               m_xnodesetAllocator;
00204 
00205     XNodeSetNodeProxyAllocator      m_xnodesetNodeProxyAllocator;
00206 
00207     XTokenNumberAdapterAllocator    m_xtokenNumberAdapterAllocator;
00208 
00209     XTokenStringAdapterAllocator    m_xtokenStringAdapterAllocator;
00210 
00211     XObjectCollectionType           m_xobjects;
00212 
00213     XNumberCacheType                m_xnumberCache;
00214 
00215     XNodeSetCacheType               m_xnodesetCache;
00216 
00217     XStringCacheType                m_xstringCache;
00218 
00219     const XalanAutoPtr<XNull>       m_XNull;
00220 
00221     const XalanAutoPtr<XBoolean>    m_xbooleanFalse;
00222 
00223     const XalanAutoPtr<XBoolean>    m_xbooleanTrue;
00224 };
00225 
00226 
00227 
00228 XALAN_CPP_NAMESPACE_END
00229 
00230 
00231 
00232 #endif  // XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.