9 template<
class Key,
class Value>
15 template<
class Key,
class Value>
19 typename map<Key,Value>::const_iterator iter;
20 typename map<Key,Value>::const_iterator em=m.
end();
21 for (iter=m.
begin();iter!=em;iter++) {
22 mMap[iter->first]=iter->second;
28 template<
class Key,
class Value>
33 template<
class Key,
class Value>
34 template<
class K2,
class V2>
36 if (
this==©Map)
return;
37 typename map<K2,V2>::const_iterator iter;
38 typename map<K2,V2>::const_iterator em=copyMap.
end();
39 for (iter=copyMap.
begin();iter!=em;iter++) {
40 mMap[(Key)iter->first]=(Value)iter->second;
43 template<
class Key,
class Value>
45 typename map<Key,Value>::const_iterator iter=
mMap.find(k);
46 if (iter==
mMap.end())
return false;
50 template<
class Key,
class Value>
52 typename map<Key,Value>::const_iterator iter=
mMap.find(k);
54 return &(iter->second);
56 template<
class Key,
class Value>
58 typename map<Key,Value>::iterator iter=
mMap.find(k);
60 return &(iter->second);
63 template<
class Key,
class Value>
68 typename map<Key,Value>::const_iterator iter=
mMap.begin();
69 typename map<Key,Value>::const_iterator
end=
mMap.end();
71 vals.
set(i++,iter->second);
75 template<
class Key,
class Value>
80 typename map<Key,Value>::const_iterator iter=
mMap.begin();
81 typename map<Key,Value>::const_iterator
end=
mMap.end();
83 vals.
set(i++,iter->second);
87 template<
class Key,
class Value>
92 typename map<Key,Value>::const_iterator iter=
mMap.begin();
93 typename map<Key,Value>::const_iterator
end=
mMap.end();
95 vals[i++]=iter->second;
102 template<
class Key,
class Value>
106 typename map<Key,Value>::const_iterator iter=
mMap.begin();
107 typename map<Key,Value>::const_iterator
end=
mMap.end();
116 template<
class Key,
class Value>
119 typename map<Key,Value>::const_iterator iter=
mMap.begin();
120 typename map<Key,Value>::const_iterator
end=
mMap.end();
122 keys.
add(iter->first);
126 template<
class Key,
class Value>
129 typename map<Key,Value>::const_iterator iter=
mMap.begin();
130 typename map<Key,Value>::const_iterator
end=
mMap.end();
132 keys.
add(iter->first);
136 template<
class Key,
class Value>
138 typename map<Key,Value>::const_iterator iter=m.
begin();
139 typename map<Key,Value>::const_iterator
end=m.
end();
141 mMap[iter->first]=iter->second;
146 template<
class Key,
class Value>
148 typename map<Key,Value>::iterator iter=
mMap.find(k);
149 if (iter!=
mMap.end()) {
156 template<
class Key,
class Value>
159 typename map<Key,Value>::iterator iter=
mMap.begin();
160 while (iter!=
mMap.end()) {
161 if (iter->second==v) {
virtual void clear()
clear the array : desallocate the array
Definition: CORE_Array.h:300
tBoolean remove(const Key &k)
remove the key
Definition: CORE_Map.hpp:147
void merge(const CORE_Map< Key, Value > &m)
merge the map
Definition: CORE_Map.hpp:137
this class describes an array
Definition: CORE_Vector.h:19
void keys(CORE_Vector< Key > &ks) const
return an array of keys
Definition: CORE_Map.h:164
void set(const tUIndex &i, const T &v)
set value at indx i
Definition: CORE_Vector.h:293
map< Key, Value > mMap
Definition: CORE_Map.h:23
tBoolean removeValue(const Value &k)
remove the value
Definition: CORE_Map.hpp:157
#define tBoolean
Definition: types.h:139
void setSize(const tUIndex &n)
set the size
Definition: CORE_Array.h:292
#define null
Definition: types.h:144
const Value * get(const Key &k) const
get the value at key k
Definition: CORE_Map.hpp:51
void getValues(CORE_Vector< Value > &vals) const
return an array of values
Definition: CORE_Map.hpp:64
map< Key, Value >::iterator begin()
get the begin iterator
Definition: CORE_Map.h:227
void getKeys(vector< Key > &ks) const
return a vector of keys
Definition: CORE_Map.hpp:103
void setSize(const tUIndex &n)
set the size of the vector
Definition: CORE_Vector.h:255
map< Key, Value >::iterator end()
get the end iterator
Definition: CORE_Map.h:239
this class describes a map
Definition: CORE_Map.h:18
this class describes an array
Definition: CORE_Array.h:19
void clear()
clear the map
Definition: CORE_Map.h:218
virtual ~CORE_Map()
destroy a map
Definition: CORE_Map.hpp:29
void add(const CORE_Vector< T > &u, const CORE_Vector< T > &v)
init the value to this=u-v
Definition: CORE_Vector.h:439
void add(const tReal &alpha, const CORE_Array< Q > &Y, const tReal &beta)
This=alpha.Y+beta.This.
Definition: CORE_Array.h:582
#define tUIndex
Definition: types.h:126
abstract base class for most classes.
Definition: CORE_Object.h:53
tBoolean exists(const Key &k) const
exists return true if the key exists in map
Definition: CORE_Map.hpp:44
void set(const tUIndex &i, const T &v)
set the value of the array at index i
Definition: CORE_Array.h:504
void copy(const CORE_Map< K2, V2 > &mapCpy)
copy a map
Definition: CORE_Map.hpp:35
CORE_Map()
build a map
Definition: CORE_Map.hpp:10
void clear()
clear the array
Definition: CORE_Vector.h:248