Xalan-C++ API Reference 1.12.0
NodeRefListBase.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(NODEREFLISTBASE_HEADER_GUARD_1357924680)
19#define NODEREFLISTBASE_HEADER_GUARD_1357924680
20
21
22
23// Base include file. Must be first.
25
26
27
28#include <cstddef>
29
30
31
32namespace XALAN_CPP_NAMESPACE {
33
34
35
36class XalanNode;
37
38
39
40/**
41 * Local implementation of NodeRefList. This class is for internal use only.
42 */
43
45{
46public:
47
49
50 virtual
52
54
55 /**
56 * Returns the <code>index</code>th item in the collection. If
57 * <code>index</code> is greater than or equal to the number of nodes in
58 * the list, this returns <code>null</code>.
59 *
60 * @param index index into the collection
61 * @return node at the <code>index</code>th position in the
62 * <code>NodeList</code>, or <code>null</code> if that is not a
63 * valid index
64 */
65 virtual XalanNode*
66 item(size_type index) const = 0;
67
68 /**
69 * Determine the number of nodes in the list. The range of valid child node
70 * indices is 0 to <code>length-1</code> inclusive.
71 *
72 * @return number of nodes
73 */
74 virtual size_type
75 getLength() const = 0;
76
77 /**
78 * Retrieve the zero based index of the node in the list
79 *
80 * @param theNode node whose index to find
81 * @return index of node
82 */
83 virtual size_type
84 indexOf(const XalanNode* theNode) const = 0;
85
86 static const size_type npos;
87
88protected:
89
93
96 {
97 return *this;
98 }
99};
100
101
102
103}
104
105
106
107#endif // NODEREFLISTBASE_HEADER_GUARD_1357924680
#define XALAN_XPATH_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Local implementation of NodeRefList.
NodeRefListBase(const NodeRefListBase &)
virtual size_type getLength() const =0
Determine the number of nodes in the list.
NodeRefListBase & operator=(const NodeRefListBase &)
static const size_type npos
virtual size_type indexOf(const XalanNode *theNode) const =0
Retrieve the zero based index of the node in the list.
virtual XalanNode * item(size_type index) const =0
Returns the indexth item in the collection.