Go to the documentation of this file.00001 #ifndef vtol_list_functions_txx_
00002 #define vtol_list_functions_txx_
00003 
00004 
00005 #include "vtol_list_functions.h"
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 template <class T>
00014 vcl_vector<T>* tagged_union(vcl_vector<T>* topolist)
00015 {
00016   if (!topolist) return 0; 
00017   vcl_vector<T> temp;
00018   typename vcl_vector<T>::iterator i;
00019 
00020   
00021   for (i=topolist->begin();i!=topolist->end(); ++i)
00022     (*i)->unset_tagged_union_flag();
00023 
00024   
00025   
00026 
00027   for (i=topolist->begin(); i!=topolist->end(); ++i)
00028     if (! (*i)->get_tagged_union_flag())
00029     {
00030       (*i)->set_tagged_union_flag();
00031       temp.push_back(*i);
00032     }
00033   
00034   (*topolist)=temp;
00035   return topolist;
00036 }
00037 
00038 template <class T>
00039 vcl_list<T>* tagged_union(vcl_list<T>* topolist)
00040 {
00041   if (!topolist) return 0; 
00042   vcl_list<T> temp;
00043   typename vcl_list<T>::iterator i;
00044 
00045   
00046   for (i=topolist->begin();i!=topolist->end(); ++i)
00047     (*i)->unset_tagged_union_flag();
00048 
00049   
00050   
00051 
00052   for (i=topolist->begin(); i!=topolist->end(); ++i)
00053     if (! (*i)->get_tagged_union_flag())
00054     {
00055       (*i)->set_tagged_union_flag();
00056       temp.push_back(*i);
00057     }
00058   
00059   (*topolist)=temp;
00060   return topolist;
00061 }
00062 
00063 #endif // vtol_list_functions_txx_