Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

NodeRefList.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(NODEREFLIST_HEADER_GUARD_1357924680)
17 #define NODEREFLIST_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
31 
32 
33 
34 XALAN_CPP_NAMESPACE_BEGIN
35 
36 
37 
42 {
43 public:
44 
45  explicit
47 
53  NodeRefList(const NodeRefList& theSource, MemoryManagerType& theManager XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR);
54 
57  {
58  return m_nodeList.getMemoryManager();
59  }
60 
66  explicit
67  NodeRefList(const NodeRefListBase& theSource, MemoryManagerType& theManager XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR);
68 
69  virtual
70  ~NodeRefList();
71 
73  operator=(const NodeRefListBase& theRHS);
74 
76  operator=(const NodeRefList& theRHS);
77 
78  bool
79  empty() const
80  {
81  return m_nodeList.empty();
82  }
83 
84 
85  // These methods are inherited from NodeRefListBase ...
86 
87  virtual XalanNode*
88  item(size_type index) const;
89 
90  virtual size_type
91  getLength() const;
92 
93  virtual size_type
94  indexOf(const XalanNode* theNode) const;
95 
96 #if !defined(NDEBUG)
97  bool
98  checkForDuplicates(MemoryManagerType& theManager) const;
99 #endif
100 
102 
103  void
104  swap(NodeRefList& theOther)
105  {
106  m_nodeList.swap(theOther.m_nodeList);
107  }
108 
109 protected:
110 
111  // Default vector allocation size. It seems high, but
112  // it's really worth it...
113  enum
114  {
115  eDefaultVectorSize = 100
116  };
117 
125  void
127  {
128  m_nodeList.reserve(eDefaultVectorSize > theSize ? eDefaultVectorSize : theSize);
129  }
130 
132 private:
133 #if defined (XALAN_DEVELOPMENT)
134  // not defined
135  NodeRefList();
136  NodeRefList(const NodeRefList& theSource);
137 #endif
138 };
139 
140 
141 
142 XALAN_CPP_NAMESPACE_END
143 
144 
145 
146 #endif // NODEREFLIST_HEADER_GUARD_1357924680
#define XALAN_DEFAULT_CONSTRACTOR_MEMORY_MGR
Definition: XalanMemoryManagement.hpp:401
Definition: XalanNode.hpp:44
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
Local implementation of NodeRefList.
Definition: NodeRefList.hpp:41
virtual size_type getLength() const =0
Determine the number of nodes in the list.
virtual XalanNode * item(size_type index) const =0
Returns the indexth item in the collection.
virtual size_type indexOf(const XalanNode *theNode) const =0
Retrieve the zero based index of the node in the list.
XalanVector< XalanNode * > NodeListVectorType
Definition: NodeRefList.hpp:101
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:42
NodeRefListBase & operator=(const NodeRefListBase &)
Definition: NodeRefListBase.hpp:102
MemoryManagerType & getMemoryManager()
Definition: NodeRefList.hpp:56
void swap(NodeRefList &theOther)
Definition: NodeRefList.hpp:104
XALAN_CPP_NAMESPACE_BEGIN typedef size_t size_type
Definition: XalanMap.hpp:44
size_t size_type
Definition: XalanVector.hpp:71
void ensureAllocation(NodeListVectorType::size_type theSize=0)
Ensure that an allocation is either the default allocation amount, or the amount specified in the par...
Definition: NodeRefList.hpp:126
bool empty() const
Definition: NodeRefList.hpp:79
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:33
NodeListVectorType m_nodeList
Definition: NodeRefList.hpp:131

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