Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XObjectFactoryDefault.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680)
19 #define XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
32 // Base class header file...
34 
35 
36 
47 
48 
49 
50 
51 XALAN_CPP_NAMESPACE_BEGIN
52 
53 
54 
55 /**
56  * This class handles the creation of XObjects and manages their lifetime.
57  */
59 {
60 public:
61 
62  // Default block size for strings.
63  enum
64  {
65  eDefaultXStringBlockSize = 10,
66  eDefaultXNumberBlockSize = 10,
67  eDefaultXNodeSetBlockSize = 10,
68  eDefaultXNodeSetNodeProxyBlockSize = 5,
69  eXNumberCacheMax = 40,
70  eXNodeSetCacheMax = 40,
71  eXStringCacheMax = 40,
72  eXResultTreeFragCacheMax = 40
73  };
74 
76 
77  /**
78  * Construct a factory for creating XObjects.
79  *
80  * @param theXStringBlockSize allocation block size
81  * @param theXNumberBlockSize allocation block size
82  * @param theXNodeSetBlockSize allocation block size
83  */
84  explicit
86  MemoryManager& theManager XALAN_DEFAULT_MEMMGR,
87  size_type theXStringBlockSize = eDefaultXStringBlockSize,
88  size_type theXNumberBlockSize = eDefaultXNumberBlockSize,
89  size_type theXNodeSetBlockSize = eDefaultXNodeSetBlockSize,
90  size_type theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize);
91 
92  static XObjectFactoryDefault*
94  MemoryManager& theManager,
95  size_type theXStringBlockSize = eDefaultXStringBlockSize,
96  size_type theXNumberBlockSize = eDefaultXNumberBlockSize,
97  size_type theXNodeSetBlockSize = eDefaultXNodeSetBlockSize,
98  size_type theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize);
99 
100 
101  virtual
103 
104  MemoryManager&
106  {
107  return m_xobjects.getMemoryManager();
108  }
109  // These methods are inherited from XObjectFactory ...
110 
111  virtual void
112  reset();
113 
114  virtual const XObjectPtr
115  createBoolean(bool theValue);
116 
117  virtual const XObjectPtr
119 
120  virtual const XObjectPtr
122 
123  virtual const XObjectPtr
124  createNumber(double theValue);
125 
126  virtual const XObjectPtr
127  createNumber(const XToken& theValue);
128 
129  virtual const XObjectPtr
130  createString(const XalanDOMString& theValue);
131 
132  virtual const XObjectPtr
133  createString(const XalanDOMChar* theValue);
134 
135  virtual const XObjectPtr
137  const XalanDOMChar* theValue,
138  XalanSize_t theLength);
139 
140  virtual const XObjectPtr
141  createString(const XToken& theValue);
142 
143  virtual const XObjectPtr
145 
146  virtual const XObjectPtr
148  const XObjectPtr& theValue,
149  XPathExecutionContext& theExecutionContext);
150 
151  virtual const XObjectPtr
153 
154  virtual const XObjectPtr
155  createUnknown(const XalanDOMString& theValue);
156 
157  virtual void
159 
164 
165 protected:
166 
167  virtual bool
169  XObject* theXObject,
170  bool fInReset = false);
171 
172 private:
173 
174  // Not implemented...
176 
178  operator=(const XObjectFactoryDefault&);
179 
180  bool
181  operator==(const XObjectFactoryDefault&) const;
182 
183 
184  // Data members...
185 
186  // This one's first, since it may be be holding references
187  // to objects in other allocators.
188  XStringAdapterAllocator m_xstringAdapterAllocator;
189 
190  XStringAllocator m_xstringAllocator;
191 
192  XStringCachedAllocator m_xstringCachedAllocator;
193 
194  XStringReferenceAllocator m_xstringReferenceAllocator;
195 
196  XNumberAllocator m_xnumberAllocator;
197 
198  XNodeSetAllocator m_xnodesetAllocator;
199 
200  XNodeSetNodeProxyAllocator m_xnodesetNodeProxyAllocator;
201 
202  XTokenNumberAdapterAllocator m_xtokenNumberAdapterAllocator;
203 
204  XTokenStringAdapterAllocator m_xtokenStringAdapterAllocator;
205 
206  XObjectCollectionType m_xobjects;
207 
208  XNumberCacheType m_xnumberCache;
209 
210  XNodeSetCacheType m_xnodesetCache;
211 
212  XStringCacheType m_xstringCache;
213 
214  XBoolean m_xbooleanFalse;
215 
216  XBoolean m_xbooleanTrue;
217 
218  XalanVector<XObjectPtr> m_references;
219 };
220 
221 
222 
223 XALAN_CPP_NAMESPACE_END
224 
225 
226 
227 #endif // XOBJECTFACTORYDEFAULT_HEADER_GUARD_1357924680
XStringCachedAllocator
Definition: XStringCachedAllocator.hpp:42
XTokenNumberAdapterAllocator.hpp
XNodeSetAllocator::size_type
ArenaAllocatorType::size_type size_type
Definition: XNodeSetAllocator.hpp:50
XObjectFactoryDefault::create
static XObjectFactoryDefault * create(MemoryManager &theManager, size_type theXStringBlockSize=eDefaultXStringBlockSize, size_type theXNumberBlockSize=eDefaultXNumberBlockSize, size_type theXNodeSetBlockSize=eDefaultXNodeSetBlockSize, size_type theXNodeSetNodeProxyBlockSize=eDefaultXNodeSetNodeProxyBlockSize)
XObjectFactoryDefault::size_type
XNodeSetAllocator::size_type size_type
Definition: XObjectFactoryDefault.hpp:75
XObjectFactoryDefault::createNodeSet
virtual const XObjectPtr createNodeSet(XalanNode *theValue)
Create a node set XObject from a node.
XObject
Class to hold XPath return types.
Definition: XObject.hpp:64
XNodeSetNodeProxyAllocator
Definition: XNodeSetNodeProxyAllocator.hpp:42
XToken
Definition: XToken.hpp:42
operator==
bool operator==(const ElemAttributeSet &theLHS, const ElemAttributeSet &theRHS)
Definition: ElemAttributeSet.hpp:111
XNumberAllocator
Definition: XNumberAllocator.hpp:42
XStringReferenceAllocator.hpp
XObjectFactoryDefault::XStringCacheType
XalanVector< XString * > XStringCacheType
Definition: XObjectFactoryDefault.hpp:163
XNodeSetAllocator
Definition: XNodeSetAllocator.hpp:42
XObjectFactoryDefault::createNodeSet
virtual const XObjectPtr createNodeSet(BorrowReturnMutableNodeRefList &theValue)
Create a node set XObject from a node list.
XObjectFactoryDefault::XObjectCollectionType
XalanVector< XObject * > XObjectCollectionType
Definition: XObjectFactoryDefault.hpp:160
XObjectFactoryDefault::getMemoryManager
MemoryManager & getMemoryManager()
Definition: XObjectFactoryDefault.hpp:105
XALAN_DEFAULT_MEMMGR
#define XALAN_DEFAULT_MEMMGR
Definition: XalanMemoryManagement.hpp:524
XalanVector.hpp
XObjectFactoryDefault::createString
virtual const XObjectPtr createString(const XToken &theValue)
Create a string XObject from an XToken.
XObjectFactoryDefault::createNumber
virtual const XObjectPtr createNumber(double theValue)
Create a numeric XObject from a number.
XALAN_XPATH_EXPORT
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:35
XObjectFactoryDefault::createNumber
virtual const XObjectPtr createNumber(const XToken &theValue)
Create a numeric XObject from an XToken.
XPathExecutionContext::GetCachedNodeList
Definition: XPathExecutionContext.hpp:333
XPathExecutionContext
Definition: XPathExecutionContext.hpp:80
XObjectFactoryDefault
This class handles the creation of XObjects and manages their lifetime.
Definition: XObjectFactoryDefault.hpp:59
XObjectFactoryDefault::~XObjectFactoryDefault
virtual ~XObjectFactoryDefault()
XObjectFactoryDefault::createBoolean
virtual const XObjectPtr createBoolean(bool theValue)
Create a boolean XObject from a boolean value.
XObjectFactoryDefault::XObjectFactoryDefault
XObjectFactoryDefault(MemoryManager &theManager XALAN_DEFAULT_MEMMGR, size_type theXStringBlockSize=eDefaultXStringBlockSize, size_type theXNumberBlockSize=eDefaultXNumberBlockSize, size_type theXNodeSetBlockSize=eDefaultXNodeSetBlockSize, size_type theXNodeSetNodeProxyBlockSize=eDefaultXNodeSetNodeProxyBlockSize)
Construct a factory for creating XObjects.
XTokenNumberAdapterAllocator
Definition: XTokenNumberAdapterAllocator.hpp:42
XObjectFactoryDefault::reset
virtual void reset()
Reset the instance.
XBoolean
Definition: XBoolean.hpp:38
XObjectFactory
This class handles the creation of XObjects and manages their lifetime.
Definition: XObjectFactory.hpp:54
XNodeSetAllocator.hpp
XPathExecutionContext::GetCachedString
Definition: XPathExecutionContext.hpp:446
XStringAllocator.hpp
XStringAdapterAllocator.hpp
XStringReferenceAllocator
Definition: XStringReferenceAllocator.hpp:42
XObjectFactoryDefault::createString
virtual const XObjectPtr createString(const XalanDOMChar *theValue)
Create a string XObject from a null-terminated array of characters.
XBoolean.hpp
XalanVector< XObject * >
XalanDOMString
Definition: XalanDOMString.hpp:46
XStringCachedAllocator.hpp
XTokenStringAdapterAllocator
Definition: XTokenStringAdapterAllocator.hpp:42
XNumberAllocator.hpp
XTokenStringAdapterAllocator.hpp
XObjectFactoryDefault::doReturnObject
virtual bool doReturnObject(XObject *theXObject, bool fInReset=false)
Return an XObject to the factory.
XObjectPtr
Class to hold XObjectPtr return types.
Definition: XObject.hpp:884
XObjectFactoryDefault::holdReference
virtual void holdReference(XObjectPtr theValue)
Hold a reference to an XObject instance until the factory is reset.
XStringAllocator
Definition: XStringAllocator.hpp:42
XObjectFactory.hpp
XNodeSetNodeProxyAllocator.hpp
XStringAdapterAllocator
Definition: XStringAdapterAllocator.hpp:42
XObjectFactoryDefault::createStringAdapter
virtual const XObjectPtr createStringAdapter(const XObjectPtr &theValue, XPathExecutionContext &theExecutionContext)
Create a string XObject that will adapt another XObject to behave like a string.
XObjectFactoryDefault::createUnknown
virtual const XObjectPtr createUnknown(const XalanDOMString &theValue)
Create an "unknown" XObject from a string.
XObjectFactoryDefault::createString
virtual const XObjectPtr createString(const XalanDOMString &theValue)
Create a string XObject from a string.
XalanNode
Definition: XalanNode.hpp:39
XObjectFactoryDefault::createStringReference
virtual const XObjectPtr createStringReference(const XalanDOMString &theValue)
Create a string XObject from a string.
XObjectFactoryDefault::XNodeSetCacheType
XalanVector< XNodeSet * > XNodeSetCacheType
Definition: XObjectFactoryDefault.hpp:162
XObjectFactoryDefault::XNumberCacheType
XalanVector< XNumber * > XNumberCacheType
Definition: XObjectFactoryDefault.hpp:161
XObjectFactoryDefault::createString
virtual const XObjectPtr createString(GetCachedString &theValue)
Create a string XObject from a cached XalanDOMString,.
XObjectFactoryDefault::createString
virtual const XObjectPtr createString(const XalanDOMChar *theValue, XalanSize_t theLength)
Create a string XObject from an array of characters.
XPathDefinitions.hpp

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.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo