Public Member Functions

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

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.

{
  return self.m_data.find(k) != self.m_data.end();
} // 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

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.

{
  CLAW_PRECOND( exists(self, k) );

  return self.m_data.find(k)->second;
} // 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

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.

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


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