SkelGIS
3.0
|
00001 /*! \file apply_list_ddag.hpp 00002 * \brief Definitions of the skeleton object ApplyList for DDAG. 00003 */ 00004 #ifndef APPLY_LIST_DDAG_H 00005 #define APPLY_LIST_DDAG_H 00006 00007 #include "../../../util/dpmap_vector.hpp" 00008 00009 namespace skelgis{ 00010 00011 //================================================================================ 00012 //Types of user functions 00013 //================================================================================ 00014 //! _ApplyListDDAG_Func structure 00015 /*! 00016 */ 00017 //------------------------------------------------------------------------------- 00018 template <class DPMap_Nodes_in, class DPMap_Edges_in, class DPMap_Nodes_out,class DPMap_Edges_out> struct _ApplyListDDAG_Func 00019 //------------------------------------------------------------------------------- 00020 { 00021 virtual void operator()(DPMap_vector<DPMap_Nodes_in>&, DPMap_vector<DPMap_Edges_in>&, DPMap_vector<DPMap_Nodes_out>&, DPMap_vector<DPMap_Edges_out>&) const=0; 00022 }; 00023 00024 //================================================================================ 00025 //Specializations of skeleton ApplyList 00026 //================================================================================ 00027 //! ApplyList structure 00028 /*! 00029 */ 00030 //------------------------------------------------------------------------------- 00031 template<class DPMap_Nodes_in, class DPMap_Edges_in, class DPMap_Nodes_out,class DPMap_Edges_out> void ApplyListDDAG(const _ApplyListDDAG_Func<DPMap_Nodes_in,DPMap_Edges_in,DPMap_Nodes_out,DPMap_Edges_out>& func, 00032 DPMap_vector<DPMap_Nodes_in>& no, DPMap_vector<DPMap_Edges_in>& ed, DPMap_vector<DPMap_Nodes_out>& no2, DPMap_vector<DPMap_Edges_out>& ed2) 00033 { 00034 for(unsigned int i=0;i<no.size();i++) 00035 { 00036 typename DPMap_Nodes_in::impl_type * im = no.getImpl(i); 00037 im->start_communications(); 00038 im->end_communications(); 00039 } 00040 for(unsigned int i=0;i<ed.size();i++) 00041 { 00042 typename DPMap_Edges_in::impl_type * im = ed.getImpl(i); 00043 im->start_communications(); 00044 im->end_communications(); 00045 } 00046 func(no,ed,no2,ed2); 00047 } 00048 /*template<class DPMap_Nodes_in, class DPMap_Edges_in, class DPMap_Nodes_out,class DPMap_Edges_out> struct ApplyListDDAG 00049 { 00050 static void apply(const _ApplyListDDAG_Func<DPMap_Nodes_in,DPMap_Edges_in,DPMap_Nodes_out,DPMap_Edges_out>& func, 00051 DPMap_vector<DPMap_Nodes_in>& no, DPMap_vector<DPMap_Edges_in>& ed, DPMap_vector<DPMap_Nodes_out>& no2, DPMap_vector<DPMap_Edges_out>& ed2) 00052 { 00053 for(int i=0;i<no.size();i++) 00054 { 00055 no[i].start_communications(); 00056 no[i].end_communications(); 00057 } 00058 for(int i=0;i<ed.size();i++) 00059 { 00060 ed[i].start_communications(); 00061 ed[i].end_communications(); 00062 } 00063 func(no,ed,no2,ed2); 00064 } 00065 };*/ 00066 //------------------------------------------------------------------------------- 00067 00068 }; 00069 00070 #endif