aGrUM  0.14.2
bijection.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 <string>
28 
29 #include <agrum/core/bijection.h>
30 
31 #ifdef GUM_DEBUG_MODE
32 # include <agrum/core/debug.h>
33 #endif
34 
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 
37 namespace gum {
38 
39  // creates (if needed) and returns the safe iterator __BijectionIterEndSafe
42  static bool first_time = true;
43 
44  if (first_time) {
45  first_time = false;
47 # ifdef GUM_DEBUG_MODE
48  __debug__::__dec_creation("BijectionIteratorSafe",
49  "__bijection_static_end",
50  0,
51  "static variable correction",
52  0);
53  __debug__::__dec_creation("HashTableConstIteratorSafe",
54  "__bijection_static_end",
55  0,
56  "static variable correction",
57  0);
58 # endif
59  }
60 
62  }
63 
64  // creates (if needed) and returns the unsafe iterator __BijectionIterEnd
66  static bool first_time = true;
67 
68  if (first_time) {
69  first_time = false;
71 # ifdef GUM_DEBUG_MODE
72  __debug__::__dec_creation("BijectionIterator",
73  "__bijection_static_end",
74  0,
75  "static variable correction",
76  0);
77  __debug__::__dec_creation("HashTableConstIterator",
78  "__bijection_static_end",
79  0,
80  "static variable correction",
81  0);
82 # endif
83  }
84 
85  return __BijectionIterEnd;
86  }
87 
88  // create the end iterator for all Bijections
92 
93  // create the end iterator for all Bijections
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 template class gum::Bijection< int, int >;
106 # endif
107 #endif
108 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
109 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
111 # endif
112 #endif
static const BijectionIterator< int, int > * end4Statics()
Creates (if needed) and returns the iterator __BijectionIterEnd.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
static const BijectionIteratorSafe< int, int > * endSafe4Statics()
Creates (if needed) and returns the iterator __BijectionIterEndSafe.
Set of pairs of elements with fast search for both elements.
Definition: bijection.h:1803
static const BijectionIterator< int, int > * __BijectionIterEnd
The unsafe iterator used by everyone.
Definition: bijection.h:1335
static const BijectionIteratorSafe< int, int > * __BijectionIterEndSafe
The safe iterator used by everyone.
Definition: bijection.h:1332
Set of pairs of elements with fast search for both elements.