aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
hashTable.cpp
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 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 /**
23  * @file
24  * @brief Outlined implementation of hash tables.
25  *
26  * @author Christophe GONZALES(@AMU) and Pierre-Henri WUILLEMIN(@LIP6)
27  */
28 
29 #include <agrum/tools/core/hashTable.h>
30 
31 #ifdef GUM_DEBUG_MODE
32 # include <agrum/tools/core/debug.h>
33 #endif
34 
35 namespace gum {
36 
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
38 
40  static bool first_time = true;
41 
42  if (first_time) {
43  first_time = false;
44  HashTableIterEnd__ = new HashTableIterator< int, int >;
45 # ifdef GUM_DEBUG_MODE
46  __debug__::dec_creation__("HashTableIterator",
47  "__hash_static_end",
48  0,
49  "static variable correction",
50  0);
51  __debug__::dec_creation__("HashTableConstIterator",
52  "__hash_static_end",
53  0,
54  "static variable correction",
55  0);
56 # endif
57  }
58 
59  return HashTableIterEnd__;
60  }
61 
62  const HashTableConstIterator< int, int >*
64  return reinterpret_cast< const HashTableConstIterator< int, int >* >(
65  end4Statics());
66  }
67 
68  const HashTableIteratorSafe< int, int >*
70  static bool first_time = true;
71 
72  if (first_time) {
73  first_time = false;
75 # ifdef GUM_DEBUG_MODE
76  __debug__::dec_creation__("HashTableIteratorSafe",
77  "__hash_static_end",
78  0,
79  "static variable correction",
80  0);
81  __debug__::dec_creation__("HashTableConstIteratorSafe",
82  "__hash_static_end",
83  0,
84  "static variable correction",
85  0);
86 # endif
87  }
88 
90  }
91 
92  const HashTableConstIteratorSafe< int, int >*
94  return reinterpret_cast< const HashTableConstIteratorSafe< int, int >* >(
95  endSafe4Statics());
96  }
97 
98  const HashTableIterator< int, int >*
101 
102  const HashTableIteratorSafe< int, int >*
105 
106 #endif // DOXYGEN_SHOULD_SKIP_THIS
107 
108 } /* namespace gum */
109 
110 
111 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
112 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
113 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
114 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
115 template class gum::HashTable< int, int >;
116 # endif
117 # endif
118 # endif
119 #endif
120 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
121 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
122 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
123 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
124 template class gum::HashTable< int, std::string >;
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 template class gum::HashTable< std::string, std::string >;
134 # endif
135 # endif
136 # endif
137 #endif
138 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
139 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
140 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
141 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
142 template class gum::HashTable< std::string, int >;
143 # endif
144 # endif
145 # endif
146 #endif
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669