mesh_conv::MC_helper_stl Class Reference

Helper class to deal with stl container. More...

#include <MC_helper_stl.hpp>

List of all members.

Static Public Member Functions

template<class TA , class TB >
static std::vector< TB > map_arg2_to_vector (const std::map< TA, TB > &m)
 convert the argument2 of a map to a vector
template<class TA , class TB >
static std::map< TB, TA > reverse_map (const std::map< TA, TB > &m)
 reverse a map from map<A,B> going to map<B,A>

Detailed Description

Helper class to deal with stl container.

Definition at line 29 of file MC_helper_stl.hpp.


Member Function Documentation

template<class TA , class TB >
static std::vector<TB> mesh_conv::MC_helper_stl::map_arg2_to_vector ( const std::map< TA, TB > &  m  )  [inline, static]

convert the argument2 of a map to a vector

Definition at line 35 of file MC_helper_stl.hpp.

00036         {
00037             typename std::map<TA,TB>::const_iterator it=m.begin();
00038             typename std::map<TA,TB>::const_iterator it_end=m.end();
00039 
00040             std::vector <TB> vec;
00041             for(;it!=it_end;++it)
00042                 vec.push_back(it->second);
00043             return vec;
00044         }

template<class TA , class TB >
static std::map<TB,TA> mesh_conv::MC_helper_stl::reverse_map ( const std::map< TA, TB > &  m  )  [inline, static]

reverse a map from map<A,B> going to map<B,A>

Definition at line 48 of file MC_helper_stl.hpp.

Referenced by mesh_conv::MC_mesh_index_vector::subdivide_mixed_mid_edge().

00049         {
00050             std::map <TB,TA> reversed;
00051             typename std::map <TA,TB> :: const_iterator it=m.begin();
00052             typename std::map <TA,TB> :: const_iterator it_end=m.end();
00053             for(;it!=it_end;++it)
00054                 reversed.insert(std::make_pair(it->second,it->first));
00055             return reversed;
00056         }

Here is the caller graph for this function:


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

Generated on Sun Apr 18 20:24:48 2010 by  doxygen 1.6.1