aGrUM  0.14.2
set.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
26 #ifndef DOXYGEN_SHOULD_SKIP_THIS
27 
28 # include <agrum/core/set.h>
29 
30 namespace gum {
31 
32  // creates (if needed) and returns the iterator __SetIterEndSafe
33  const SetIteratorSafe< int >* SetIteratorStaticEnd::endSafe4Statics() {
34  static bool first_time = true;
35 
36  if (first_time) {
37  first_time = false;
38  __SetIterEndSafe = new SetIteratorSafe< int >;
39 # ifdef GUM_DEBUG_MODE
40  __debug__::__dec_creation("SetIteratorSafe",
41  "__set_static_end",
42  0,
43  "static variable correction",
44  0);
45  __debug__::__dec_creation("HashTableConstIteratorSafe",
46  "__set_static_end",
47  0,
48  "static variable correction",
49  0);
50 # endif
51  }
52 
53  return __SetIterEndSafe;
54  }
55 
56  // creates (if needed) and returns the iterator __SetIterEndSafe
57  const SetIteratorSafe< int >* SetIteratorStaticEnd::constEndSafe4Statics() {
58  return endSafe4Statics();
59  }
60 
61  // creates (if needed) and returns the iterator __SetIterEnd
62  const SetIterator< int >* SetIteratorStaticEnd::end4Statics() {
63  static bool first_time = true;
64 
65  if (first_time) {
66  first_time = false;
67  __SetIterEnd = new SetIterator< int >;
68 # ifdef GUM_DEBUG_MODE
69  __debug__::__dec_creation(
70  "SetIterator", "__set_static_end", 0, "static variable correction", 0);
71  __debug__::__dec_creation("HashTableConstIterator",
72  "__set_static_end",
73  0,
74  "static variable correction",
75  0);
76 # endif
77  }
78 
79  return __SetIterEnd;
80  }
81 
82  // creates (if needed) and returns the iterator __SetIterEnd
83  const SetIterator< int >* SetIteratorStaticEnd::constEnd4Statics() {
84  return end4Statics();
85  }
86 
87  // create the end iterator for all Sets
88  const SetIteratorSafe< int >* SetIteratorStaticEnd::__SetIterEndSafe =
89  SetIteratorStaticEnd::endSafe4Statics();
90 
91  // create the end iterator for all Sets
92  const SetIterator< int >* SetIteratorStaticEnd::__SetIterEnd =
93  SetIteratorStaticEnd::end4Statics();
94 
95 } /* namespace gum */
96 
97 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
98 
99 
100 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
101 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
102 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
103 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
104 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
105 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
106 template class gum::Set< int >;
107 # endif
108 # endif
109 # endif
110 # endif
111 # endif
112 #endif
113 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
114 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
115 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
116 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
117 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
118 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
119 template class gum::Set< long >;
120 # endif
121 # endif
122 # endif
123 # endif
124 # endif
125 #endif
126 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
127 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
128 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
129 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
130 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
131 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
132 template class gum::Set< unsigned int >;
133 # endif
134 # endif
135 # endif
136 # endif
137 # endif
138 #endif
139 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
140 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
141 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
142 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
143 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
144 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
145 template class gum::Set< unsigned long >;
146 # endif
147 # endif
148 # endif
149 # endif
150 # endif
151 #endif
152 
153 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
154 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
155 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
156 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
157 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
158 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
159 template class gum::Set< double >;
160 # endif
161 # endif
162 # endif
163 # endif
164 # endif
165 #endif
166 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
167 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
168 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
169 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
170 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
171 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
172 template class gum::Set< std::string >;
173 # endif
174 # endif
175 # endif
176 # endif
177 # endif
178 #endif
Sets of elements (i.e.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:162