aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
set.cpp
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /** @file
23  * @brief Outlined implementation of Sets
24  *
25  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
26  */
27 
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 
30 # include <agrum/tools/core/set.h>
31 
32 namespace gum {
33 
34  // creates (if needed) and returns the iterator _SetIterEndSafe_
36  static bool first_time = true;
37 
38  if (first_time) {
39  first_time = false;
40  _SetIterEndSafe_ = new SetIteratorSafe< int >;
41 # ifdef GUM_DEBUG_MODE
42  __debug__::_dec_creation_("SetIteratorSafe",
43  " __set_static_end",
44  0,
45  "static variable correction",
46  0);
47  __debug__::_dec_creation_("HashTableConstIteratorSafe",
48  " __set_static_end",
49  0,
50  "static variable correction",
51  0);
52 # endif
53  }
54 
55  return _SetIterEndSafe_;
56  }
57 
58  // creates (if needed) and returns the iterator _SetIterEndSafe_
60  return endSafe4Statics();
61  }
62 
63  // creates (if needed) and returns the iterator _SetIterEnd_
65  static bool first_time = true;
66 
67  if (first_time) {
68  first_time = false;
69  _SetIterEnd_ = new SetIterator< int >;
70 # ifdef GUM_DEBUG_MODE
71  __debug__::_dec_creation_("SetIterator",
72  " __set_static_end",
73  0,
74  "static variable correction",
75  0);
76  __debug__::_dec_creation_("HashTableConstIterator",
77  " __set_static_end",
78  0,
79  "static variable correction",
80  0);
81 # endif
82  }
83 
84  return _SetIterEnd_;
85  }
86 
87  // creates (if needed) and returns the iterator _SetIterEnd_
88  const SetIterator< int >* SetIteratorStaticEnd::constEnd4Statics() { return end4Statics(); }
89 
90  // create the end iterator for all Sets
93 
94  // create the end iterator for all Sets
97 
98 } /* namespace gum */
99 
100 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
101 
102 
103 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
104 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
105 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
106 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
107 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
108 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
109 template class gum::Set< int >;
110 # endif
111 # endif
112 # endif
113 # endif
114 # endif
115 #endif
116 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
117 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
118 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
119 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
120 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
121 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
122 template class gum::Set< long >;
123 # endif
124 # endif
125 # endif
126 # endif
127 # endif
128 #endif
129 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
130 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
131 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
132 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
133 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
134 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
135 template class gum::Set< unsigned int >;
136 # endif
137 # endif
138 # endif
139 # endif
140 # endif
141 #endif
142 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
143 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
144 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
145 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
146 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
147 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
148 template class gum::Set< unsigned long >;
149 # endif
150 # endif
151 # endif
152 # endif
153 # endif
154 #endif
155 
156 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
157 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
158 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
159 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
160 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
161 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
162 template class gum::Set< double >;
163 # endif
164 # endif
165 # endif
166 # endif
167 # endif
168 #endif
169 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
170 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
171 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
172 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
173 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
174 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
175 template class gum::Set< std::string >;
176 # endif
177 # endif
178 # endif
179 # endif
180 # endif
181 #endif
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643