Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

MutableNodeRefList.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(MUTABLENODEREFLIST_HEADER_GUARD_1357924680)
17 #define MUTABLENODEREFLIST_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 XALAN_CPP_NAMESPACE_BEGIN
31 
32 
33 
35 class XalanDocument;
36 class XalanNodeList;
37 
38 
39 
45 {
46 public:
47 
51  explicit
53 
54  static MutableNodeRefList*
55  create(MemoryManagerType& theManager);
61  MutableNodeRefList(const MutableNodeRefList& theSource,
62  MemoryManagerType& theManager);
63 
69  explicit
70  MutableNodeRefList(const NodeRefListBase& theSource,
71  MemoryManagerType& theManager);
72 
73  virtual
75 
77  operator=(const MutableNodeRefList& theRHS);
78 
80  operator=(const NodeRefList& theRHS);
81 
83  operator=(const NodeRefListBase& theRHS);
84 
86  operator=(const XalanNodeList* theRHS);
87 
93  void
94  addNode(XalanNode* n);
95 
102  void
103  insertNode(
104  XalanNode* n,
105  size_type pos);
106 
112  void
113  removeNode(const XalanNode* n);
114 
120  void
121  removeNode(size_type pos);
122 
126  void
127  clear();
128 
135  void
136  setNode(
137  size_type pos,
138  XalanNode* n = 0);
139 
146  void
147  addNodes(const XalanNodeList& nodelist);
148 
155  void
156  addNodes(const NodeRefListBase& nodelist);
157 
164  void
165  addNodesInDocOrder(
166  const XalanNodeList& nodelist,
167  XPathExecutionContext& executionContext);
168 
175  void
176  addNodesInDocOrder(
177  const NodeRefListBase& nodelist,
178  XPathExecutionContext& executionContext);
179 
186  void
187  addNodesInDocOrder(
188  const MutableNodeRefList& nodelist,
189  XPathExecutionContext& executionContext);
190 
197  void
198  addNodeInDocOrder(
199  XalanNode* node,
200  XPathExecutionContext& executionContext);
201 
205  void
206  clearNulls();
207 
211  void
212  reverse();
213 
228  void
229  reserve(size_type theCount)
230  {
231  m_nodeList.reserve(theCount);
232  }
233 
237  bool
239  {
240  return m_order == eUnknownOrder ? true : false;
241  }
242 
243  void
245  {
246  m_order = eUnknownOrder;
247  }
248 
252  bool
254  {
255  return m_order == eDocumentOrder ? true : false;
256  }
257 
263  void
265  {
266  m_order = eDocumentOrder;
267  }
268 
272  bool
274  {
275  return m_order == eReverseDocumentOrder ? true : false;
276  }
277 
283  void
285  {
286  m_order = eReverseDocumentOrder;
287  }
288 
290 
292  {
293  public:
294 
296  MutableNodeRefList& theList,
297  XPathExecutionContext& theExecutionContext) :
298  m_list(theList),
299  m_executionContext(theExecutionContext)
300  {
301  }
302 
303  void
304  operator()(XalanNode* theNode) const
305  {
306  m_list.addNodeInDocOrder(theNode, m_executionContext);
307  }
308 
309  private:
310 
311  MutableNodeRefList& m_list;
312 
313  XPathExecutionContext& m_executionContext;
314  };
315 
316  void
318  {
319  NodeRefList::swap(theOther);
320 
321  const eOrder temp = m_order;
322 
323  m_order = theOther.m_order;
324 
325  theOther.m_order = temp;
326  }
327 
328 private:
329  //not defined
330  MutableNodeRefList(const MutableNodeRefList& theSource);
331 
332  // An enum to determine what the order of the nodes is...
333  enum eOrder { eUnknownOrder, eDocumentOrder, eReverseDocumentOrder };
334 
335  eOrder m_order;
336 };
337 
339 
340 XALAN_CPP_NAMESPACE_END
341 
342 
343 
344 #endif // MUTABLENODEREFLIST_HEADER_GUARD_1357924680
Definition: XalanNode.hpp:44
Definition: XalanNodeList.hpp:42
Local implementation of MutableNodeRefList.
Definition: MutableNodeRefList.hpp:44
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
bool getUnknownOrder() const
See if the order of the nodes is an unknown order.
Definition: MutableNodeRefList.hpp:238
addNodeInDocOrderFunctor(MutableNodeRefList &theList, XPathExecutionContext &theExecutionContext)
Definition: MutableNodeRefList.hpp:295
value_type * iterator
Definition: XalanVector.hpp:91
void operator()(XalanNode *theNode) const
Definition: MutableNodeRefList.hpp:304
void setReverseDocumentOrder()
Set the known order of the nodes.
Definition: MutableNodeRefList.hpp:284
Local implementation of NodeRefList.
Definition: NodeRefList.hpp:41
void clear(XalanDOMString &theString)
Remove all elements from target string.
Definition: DOMStringHelper.hpp:2291
Definition: MutableNodeRefList.hpp:291
Definition: XPathExecutionContext.hpp:72
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:42
bool getReverseDocumentOrder() const
See if the order of the nodes is reverse document order.
Definition: MutableNodeRefList.hpp:273
void swap(MutableNodeRefList &theOther)
Definition: MutableNodeRefList.hpp:317
void swap(NodeRefList &theOther)
Definition: NodeRefList.hpp:104
bool getDocumentOrder() const
See if the order of the nodes is document order.
Definition: MutableNodeRefList.hpp:253
NodeListVectorType::iterator NodeListIteratorType
Definition: MutableNodeRefList.hpp:289
Definition: XalanDocument.hpp:51
void setUnknownOrder()
Definition: MutableNodeRefList.hpp:244
NodeRefList & operator=(const NodeRefListBase &theRHS)
#define XALAN_USES_MEMORY_MANAGER(Type)
Definition: XalanMemoryManagement.hpp:468
unsigned int size_type
Definition: NodeRefListBase.hpp:56
void reserve(size_type theCount)
Reserve space for the supplied number of nodes.
Definition: MutableNodeRefList.hpp:229
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:33
void setDocumentOrder()
Set the known order of the nodes.
Definition: MutableNodeRefList.hpp:264

Interpreting class diagrams

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

dot

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

Apache Logo