16 template <
class Key,
class Value>
70 p=boost::dynamic_pointer_cast<
const CORE_Map<Key,Value> >(r);
75 inline boost::shared_ptr<CORE_Map<Key,Value> >
getThis() {
76 boost::shared_ptr<CORE_Map<Key,Value> > p;
82 inline boost::shared_ptr<const CORE_Map<Key,Value> >
getThis()
const {
83 boost::shared_ptr<const CORE_Map<Key,Value> > p;
92 static inline boost::shared_ptr<CORE_Map<Key,Value> >
New() {
93 boost::shared_ptr<CORE_Map<Key,Value> > p(
new CORE_Map<Key,Value>(),
105 typename map<Key,Value>::const_iterator iter=mMap.find(k);
106 if (iter==mMap.end())
107 throw CORE_Exception(
"common/core",
"CORE_Map[]",
"key does not exists !");
116 typename map<Key,Value>::iterator iter=mMap.find(k);
117 if (iter==mMap.end())
118 throw CORE_Exception(
"common/core",
"CORE_Map[]",
"key does not exists !");
129 tBoolean exists(
const Key& k)
const;
134 const Value*
get(
const Key& k)
const;
139 Value*
get(
const Key& k);
160 void getValues(vector<Value>& vals)
const;
170 void getKeys(vector<Key>& ks)
const;
183 template<
class K2,
class V2>
189 inline void put(
const Key& k,
const Value& v) {
195 inline void add(
const Value& v) {
213 tBoolean removeValue(
const Value& k);
227 inline typename map<Key,Value>::iterator
begin() {
233 inline typename map<Key,Value>::const_iterator
begin()
const {
239 inline typename map<Key,Value>::iterator
end() {
247 inline typename map<Key,Value>::const_iterator
end()
const {
255 void merge(
const CORE_Map<Key,Value>& m);
void add(const Value &v)
set the value at the index k
Definition: CORE_Map.h:195
CORE_Map< tString, SP::CORE_Object > CORE_StringObjectMap
Definition: CORE_Map.h:268
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
boost::shared_ptr< CORE_Map< Key, Value > > getThis()
return the shared pointer this
Definition: CORE_Map.h:75
map< Key, Value > mMap
Definition: CORE_Map.h:23
#define tBoolean
Definition: types.h:139
void values(CORE_Vector< Value > &vals) const
return an array of values
Definition: CORE_Map.h:148
Value & operator[](const Key &k)
get object corresponding to k
Definition: CORE_Map.h:115
tUIndex getSize() const
return the size of the array
Definition: CORE_Map.h:145
map< Key, Value >::iterator begin()
get the begin iterator
Definition: CORE_Map.h:227
TYPEDEF_SPTR(CORE_StringRealMap)
void getSharedPointer(boost::shared_ptr< CORE_Map< Key, Value > > &p)
return the shared pointer corresponding to the class with casting
Definition: CORE_Map.h:60
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:15
void put(const Key &k, const Value &v)
set the value at the index k
Definition: CORE_Map.h:189
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
static boost::shared_ptr< CORE_Map< Key, Value > > New()
return a CORE_Array shared pointer
Definition: CORE_Map.h:92
void clear()
clear the map
Definition: CORE_Map.h:218
const Value & operator[](const Key &k) const
get object corresponding to k
Definition: CORE_Map.h:104
void getSharedPointer(SP::CORE_Object &p)
get the shared pointer of this class into p
Definition: CORE_Object.h:97
#define tUIndex
Definition: types.h:126
abstract base class for most classes.
Definition: CORE_Object.h:53
CORE_Map< tString, int > CORE_StringIntMap
Definition: CORE_Map.h:267
void getSharedPointer(boost::shared_ptr< const CORE_Map< Key, Value > > &p) const
return the shared pointer corresponding to the class whith casting
Definition: CORE_Map.h:67
CORE_Map< tString, tReal > CORE_StringRealMap
Definition: CORE_Map.h:266
map< Key, Value >::const_iterator begin() const
get the begin iterator
Definition: CORE_Map.h:233
map< Key, Value >::const_iterator end() const
get the end iterator
Definition: CORE_Map.h:247
tUIndex size() const
return the size of the array
Definition: CORE_Map.h:142
boost::shared_ptr< const CORE_Map< Key, Value > > getThis() const
return the shared pointer this
Definition: CORE_Map.h:82
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141