00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(NODEREFLIST_HEADER_GUARD_1357924680) 00019 #define NODEREFLIST_HEADER_GUARD_1357924680 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include <xalanc/XPath/XPathDefinitions.hpp> 00025 00026 00027 00028 #include <xalanc/Include/XalanVector.hpp> 00029 00030 00031 00032 #include <xalanc/XPath/NodeRefListBase.hpp> 00033 00034 00035 00036 XALAN_CPP_NAMESPACE_BEGIN 00037 00038 00039 00040 /** 00041 * Local implementation of NodeRefList. This class is for internal use only. 00042 */ 00043 class XALAN_XPATH_EXPORT NodeRefList : public NodeRefListBase 00044 { 00045 public: 00046 00047 explicit 00048 NodeRefList(MemoryManager& theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR); 00049 00050 /** 00051 * Construct a node list from another 00052 * 00053 * @param theSource source node list 00054 */ 00055 NodeRefList( 00056 const NodeRefList& theSource, 00057 MemoryManager& theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR); 00058 00059 MemoryManager& 00060 getMemoryManager() 00061 { 00062 return m_nodeList.getMemoryManager(); 00063 } 00064 00065 /** 00066 * Construct a node list from another 00067 * 00068 * @param theSource source node list 00069 */ 00070 explicit 00071 NodeRefList( 00072 const NodeRefListBase& theSource, 00073 MemoryManager& theManager XALAN_DEFAULT_CONSTRUCTOR_MEMMGR); 00074 00075 virtual 00076 ~NodeRefList(); 00077 00078 NodeRefList& 00079 operator=(const NodeRefListBase& theRHS); 00080 00081 NodeRefList& 00082 operator=(const NodeRefList& theRHS); 00083 00084 bool 00085 empty() const 00086 { 00087 return m_nodeList.empty(); 00088 } 00089 00090 00091 // These methods are inherited from NodeRefListBase ... 00092 00093 virtual XalanNode* 00094 item(size_type index) const; 00095 00096 virtual size_type 00097 getLength() const; 00098 00099 virtual size_type 00100 indexOf(const XalanNode* theNode) const; 00101 00102 #if !defined(NDEBUG) 00103 bool 00104 checkForDuplicates(MemoryManager& theManager) const; 00105 #endif 00106 00107 typedef XalanVector<XalanNode*> NodeListVectorType; 00108 00109 void 00110 swap(NodeRefList& theOther) 00111 { 00112 m_nodeList.swap(theOther.m_nodeList); 00113 } 00114 00115 protected: 00116 00117 // Default vector allocation size. It seems high, but 00118 // it's really worth it... 00119 enum 00120 { 00121 eDefaultVectorSize = 100 00122 }; 00123 00124 /** 00125 * Ensure that an allocation is either the default allocation 00126 * amount, or the amount specified in the parameter, whichever 00127 * is larger. 00128 * 00129 * @param theSize The requested size. 00130 */ 00131 void 00132 ensureAllocation(NodeListVectorType::size_type theSize = 0) 00133 { 00134 m_nodeList.reserve(eDefaultVectorSize > theSize ? eDefaultVectorSize : theSize); 00135 } 00136 00137 NodeListVectorType m_nodeList; 00138 private: 00139 #if defined (XALAN_DEVELOPMENT) 00140 // not defined 00141 NodeRefList(); 00142 NodeRefList(const NodeRefList& theSource); 00143 #endif 00144 }; 00145 00146 00147 00148 XALAN_CPP_NAMESPACE_END 00149 00150 00151 00152 #endif // NODEREFLIST_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.11 |
|