claw::multi_type_map_wrapper< ValueType, Map >::last_call Class Reference

When ValueType matches Map::value_type, this class is defined as the method to call. More...

List of all members.

Public Member Functions

const ValueType & get (const Map &self, const typename Map::key_type &k) const
 Get a value from the map.
void set (Map &self, const typename Map::key_type &k, const ValueType &v) const
 Set a value in the map.
bool exists (const Map &self, const typename Map::key_type &k) const
 Tell if the map contains a value of a given type with a given key.

Detailed Description

template<typename ValueType, typename Map>
class claw::multi_type_map_wrapper< ValueType, Map >::last_call

When ValueType matches Map::value_type, this class is defined as the method to call.

Definition at line 57 of file multi_type_map.tpp.


Member Function Documentation

template<typename ValueType , typename Map >
bool claw::multi_type_map_wrapper< ValueType, Map >::last_call::exists ( const Map &  self,
const typename Map::key_type &  k 
) const [inline]

Tell if the map contains a value of a given type with a given key.

Parameters:
self The map in which we search the key.
k The key of the value to get.

Definition at line 136 of file multi_type_map.tpp.

00137 {
00138   return self.m_data.find(k) != self.m_data.end();
00139 } // multi_type_map_wrapper::last_call::exists()

template<typename ValueType , typename Map >
const ValueType & claw::multi_type_map_wrapper< ValueType, Map >::last_call::get ( const Map &  self,
const typename Map::key_type &  k 
) const [inline]

Get a value from the map.

Parameters:
self The map in which we search the key.
k The key of the value to get.

Definition at line 107 of file multi_type_map.tpp.

References CLAW_PRECOND.

00108 {
00109   CLAW_PRECOND( exists(self, k) );
00110 
00111   return self.m_data.find(k)->second;
00112 } // multi_type_map_wrapper::last_call::get()

template<typename ValueType , typename Map >
void claw::multi_type_map_wrapper< ValueType, Map >::last_call::set ( Map &  self,
const typename Map::key_type &  k,
const ValueType &  v 
) const [inline]

Set a value in the map.

Parameters:
self The map in which we search the key.
k The key of the value to set.
v The value to set.

Definition at line 123 of file multi_type_map.tpp.

00124 {
00125   self.m_data[k] = v;
00126 } // multi_type_map_wrapper::last_call::set()


The documentation for this class was generated from the following file:

Generated on 9 Nov 2009 for CLAW Library (a C++ Library Absolutely Wonderful) by  doxygen 1.6.1