aGrUM  0.13.2
hashTable.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  ***************************************************************************/
27 #include <agrum/core/hashTable.h>
28 
29 #ifndef NDEBUG
30 # include <agrum/core/debug.h>
31 #endif
32 
33 namespace gum {
34 
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 
38  static bool first_time = true;
39 
40  if (first_time) {
41  first_time = false;
43 # ifndef NDEBUG
44  __debug__::__dec_creation("HashTableIterator",
45  "__hash_static_end",
46  0,
47  "static variable correction",
48  0);
49  __debug__::__dec_creation("HashTableConstIterator",
50  "__hash_static_end",
51  0,
52  "static variable correction",
53  0);
54 # endif
55  }
56 
57  return __HashTableIterEnd;
58  }
59 
62  return reinterpret_cast< const HashTableConstIterator< int, int >* >(
63  end4Statics());
64  }
65 
68  static bool first_time = true;
69 
70  if (first_time) {
71  first_time = false;
73 # ifndef NDEBUG
74  __debug__::__dec_creation("HashTableIteratorSafe",
75  "__hash_static_end",
76  0,
77  "static variable correction",
78  0);
79  __debug__::__dec_creation("HashTableConstIteratorSafe",
80  "__hash_static_end",
81  0,
82  "static variable correction",
83  0);
84 # endif
85  }
86 
88  }
89 
92  return reinterpret_cast< const HashTableConstIteratorSafe< int, int >* >(
93  endSafe4Statics());
94  }
95 
99 
103 
104 #endif // DOXYGEN_SHOULD_SKIP_THIS
105 
106 } /* namespace gum */
107 
108 
109 template class gum::HashTable< int, int >;
static const HashTableIterator< int, int > * __HashTableIterEnd
The unsafe iterator used by everyone.
Definition: hashTable.h:1831
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
static const HashTableConstIteratorSafe< int, int > * constEndSafe4Statics()
Creates (if needed) and returns the iterator __HashTableIterEndSafe.
static const HashTableIterator< int, int > * end4Statics()
Creates (if needed) and returns the iterator __HashTableIterEnd.
static const HashTableIteratorSafe< int, int > * endSafe4Statics()
Creates (if needed) and returns the iterator __HashTableIterEndSafe.
static const HashTableIteratorSafe< int, int > * __HashTableIterEndSafe
The safe iterator used by everyone.
Definition: hashTable.h:1834
static const HashTableConstIterator< int, int > * constEnd4Statics()
Creates (if needed) and returns the iterator __HashTableIterEnd.
Class hash tables iterators.