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(MUTABLENODEREFLIST_HEADER_GUARD_1357924680) 00017 #define MUTABLENODEREFLIST_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/XPath/NodeRefList.hpp> 00027 00028 00029 00030 XALAN_CPP_NAMESPACE_BEGIN 00031 00032 00033 00034 class XPathExecutionContext; 00035 class XalanDocument; 00036 class XalanNodeList; 00037 00038 00039 00044 class XALAN_XPATH_EXPORT MutableNodeRefList : public NodeRefList 00045 { 00046 public: 00047 00051 explicit 00052 MutableNodeRefList(); 00053 00059 MutableNodeRefList(const MutableNodeRefList& theSource); 00060 00066 explicit 00067 MutableNodeRefList(const NodeRefListBase& theSource); 00068 00069 virtual 00070 ~MutableNodeRefList(); 00071 00072 MutableNodeRefList& 00073 operator=(const MutableNodeRefList& theRHS); 00074 00075 MutableNodeRefList& 00076 operator=(const NodeRefList& theRHS); 00077 00078 MutableNodeRefList& 00079 operator=(const NodeRefListBase& theRHS); 00080 00081 MutableNodeRefList& 00082 operator=(const XalanNodeList* theRHS); 00083 00089 void 00090 addNode(XalanNode* n); 00091 00098 void 00099 insertNode( 00100 XalanNode* n, 00101 size_type pos); 00102 00108 void 00109 removeNode(const XalanNode* n); 00110 00116 void 00117 removeNode(size_type pos); 00118 00122 void 00123 clear(); 00124 00131 void 00132 setNode( 00133 size_type pos, 00134 XalanNode* n = 0); 00135 00142 void 00143 addNodes(const XalanNodeList& nodelist); 00144 00151 void 00152 addNodes(const NodeRefListBase& nodelist); 00153 00160 void 00161 addNodesInDocOrder( 00162 const XalanNodeList& nodelist, 00163 XPathExecutionContext& executionContext); 00164 00171 void 00172 addNodesInDocOrder( 00173 const NodeRefListBase& nodelist, 00174 XPathExecutionContext& executionContext); 00175 00182 void 00183 addNodesInDocOrder( 00184 const MutableNodeRefList& nodelist, 00185 XPathExecutionContext& executionContext); 00186 00193 void 00194 addNodeInDocOrder( 00195 XalanNode* node, 00196 XPathExecutionContext& executionContext); 00197 00201 void 00202 clearNulls(); 00203 00207 void 00208 reverse(); 00209 00215 void 00216 reverseAssign(MutableNodeRefList& nodelist) const; 00217 00232 void 00233 reserve(size_type theCount) 00234 { 00235 m_nodeList.reserve(theCount); 00236 } 00237 00241 bool 00242 getUnknownOrder() const 00243 { 00244 return m_order == eUnknownOrder ? true : false; 00245 } 00246 00247 void 00248 setUnknownOrder() 00249 { 00250 m_order = eUnknownOrder; 00251 } 00252 00256 bool 00257 getDocumentOrder() const 00258 { 00259 return m_order == eDocumentOrder ? true : false; 00260 } 00261 00267 void 00268 setDocumentOrder() 00269 { 00270 m_order = eDocumentOrder; 00271 } 00272 00276 bool 00277 getReverseDocumentOrder() const 00278 { 00279 return m_order == eReverseDocumentOrder ? true : false; 00280 } 00281 00287 void 00288 setReverseDocumentOrder() 00289 { 00290 m_order = eReverseDocumentOrder; 00291 } 00292 00293 typedef NodeListVectorType::iterator NodeListIteratorType; 00294 00295 class addNodeInDocOrderFunctor 00296 { 00297 public: 00298 00299 addNodeInDocOrderFunctor( 00300 MutableNodeRefList& theList, 00301 XPathExecutionContext& theExecutionContext) : 00302 m_list(theList), 00303 m_executionContext(theExecutionContext) 00304 { 00305 } 00306 00307 void 00308 operator()(XalanNode* theNode) const 00309 { 00310 m_list.addNodeInDocOrder(theNode, m_executionContext); 00311 } 00312 00313 private: 00314 00315 MutableNodeRefList& m_list; 00316 00317 XPathExecutionContext& m_executionContext; 00318 }; 00319 00320 void 00321 swap(MutableNodeRefList& theOther) 00322 { 00323 NodeRefList::swap(theOther); 00324 00325 const eOrder temp = m_order; 00326 00327 m_order = theOther.m_order; 00328 00329 theOther.m_order = temp; 00330 } 00331 00332 private: 00333 00334 // An enum to determine what the order of the nodes is... 00335 enum eOrder { eUnknownOrder, eDocumentOrder, eReverseDocumentOrder }; 00336 00337 eOrder m_order; 00338 }; 00339 00340 00341 00342 XALAN_CPP_NAMESPACE_END 00343 00344 00345 00346 #endif // MUTABLENODEREFLIST_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.8 |
|