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

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