Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XalanSet.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 
21 #if !defined(XALANSET_HEADER_GUARD_1357924680)
22 #define XALANSET_HEADER_GUARD_1357924680
23 
24 
25 
26 // Base include file. Must be first.
29 
30 
31 
33 
34 
35 
36 XALAN_CPP_NAMESPACE_BEGIN
37 
38 
39 
40 template <class Value, class MapIterator>
42 {
43  typedef Value value_type;
44 
45  typedef Value& reference;
46  typedef Value* pointer;
47 
48  XalanSetIterator(const MapIterator & iter) :
49  m_mapIterator(iter)
50  {
51  }
52 
54  {
55  return m_mapIterator->first;
56  };
57 
58  bool operator==(const XalanSetIterator& theRhs) const
59  {
60  return theRhs.m_mapIterator == m_mapIterator;
61  }
62 
63  bool operator!=(const XalanSetIterator& theRhs) const
64  {
65  return !(theRhs == *this);
66  }
67 
69  {
70  ++m_mapIterator;
71  return *this;
72  }
73 
75  {
77  ++(*this);
78  return orig;
79  }
80 
81 protected:
82  MapIterator m_mapIterator;
83 };
84 
85 
92 template <class Value>
93 class XalanSet
94 {
95 public:
96 
97  typedef Value value_type;
98 
99  typedef size_t size_type;
100 
102 
105 
106  XalanSet(MemoryManagerType& theMemoryManager) :
107  m_map(theMemoryManager)
108  {
109  }
110 
111  XalanSet(const XalanSet& other,
112  MemoryManagerType& theMemoryManager) :
113  m_map(other.m_map, theMemoryManager)
114  {
115  }
116 
119  {
120  return m_map.getMemoryManager();
121  }
122 
124  {
125  return m_map.begin();
126  }
127 
129  {
130  return m_map.end();
131  }
132 
133  size_type size() const {
134  return m_map.size();
135  }
136 
137  size_type count(const value_type & value) const
138  {
139  if (find(value) != end())
140  {
141  return 1;
142  }
143  else
144  {
145  return 0;
146  }
147  }
148 
149  const_iterator find(const value_type& value) const
150  {
151  return m_map.find(value);
152  }
153 
154  void insert(const value_type& value)
155  {
156  typedef typename SetMapType::value_type MapValueType;
157  m_map.insert(value, true);
158  }
159 
160  size_type erase(const value_type& value)
161  {
162  return m_map.erase(value);
163  }
164 
165  void clear()
166  {
167  m_map.clear();
168  }
169 
171 };
172 
173 
174 
175 XALAN_CPP_NAMESPACE_END
176 
177 #endif // XALANSET_HEADER_GUARD_1357924680
Value & reference
Definition: XalanSet.hpp:45
void insert(const value_type &value)
Definition: XalanSet.hpp:154
reference operator*() const
Definition: XalanSet.hpp:53
MemoryManagerType & getMemoryManager()
Definition: XalanSet.hpp:118
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
void clear()
Definition: XalanSet.hpp:165
XalanSetIterator operator++()
Definition: XalanSet.hpp:68
SetMapType m_map
Definition: XalanSet.hpp:170
XalanMap< value_type, bool > SetMapType
Definition: XalanSet.hpp:101
Definition: XalanSet.hpp:41
MemoryManagerType & getMemoryManager()
Definition: XalanMap.hpp:283
MapIterator m_mapIterator
Definition: XalanSet.hpp:82
Value value_type
Definition: XalanSet.hpp:43
size_t size_type
Definition: XalanSet.hpp:99
iterator find(const key_type &key)
Definition: XalanMap.hpp:346
XalanSetIterator operator++(int)
Definition: XalanSet.hpp:74
bool operator==(const XalanSetIterator &theRhs) const
Definition: XalanSet.hpp:58
iterator end()
Definition: XalanMap.hpp:336
Definition: XalanQNameByReference.hpp:35
const_iterator find(const value_type &value) const
Definition: XalanSet.hpp:149
void clear()
Definition: XalanMap.hpp:428
XalanSetIterator(const MapIterator &iter)
Definition: XalanSet.hpp:48
XalanSet(MemoryManagerType &theMemoryManager)
Definition: XalanSet.hpp:106
void erase(iterator pos)
Definition: XalanMap.hpp:404
XalanSetIterator< const value_type, typename SetMapType::const_iterator > const_iterator
Definition: XalanSet.hpp:104
bool operator!=(const XalanSetIterator &theRhs) const
Definition: XalanSet.hpp:63
const_iterator end() const
Definition: XalanSet.hpp:128
XALAN_STD_QUALIFIER pair< const key_type, data_type > value_type
Definition: XalanMap.hpp:197
size_type count(const value_type &value) const
Definition: XalanSet.hpp:137
XalanSet(const XalanSet &other, MemoryManagerType &theMemoryManager)
Definition: XalanSet.hpp:111
size_type size() const
Definition: XalanMap.hpp:316
const_iterator begin() const
Definition: XalanSet.hpp:123
iterator begin()
Definition: XalanMap.hpp:326
void insert(const value_type &value)
Definition: XalanMap.hpp:389
size_type size() const
Definition: XalanSet.hpp:133
Value value_type
Definition: XalanSet.hpp:97
Xalan set implementation.
Definition: XalanSet.hpp:93
size_type erase(const value_type &value)
Definition: XalanSet.hpp:160
XalanSetIterator< value_type, typename SetMapType::iterator > iterator
Definition: XalanSet.hpp:103
Value * pointer
Definition: XalanSet.hpp:46

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