lemon/path.h
changeset 534 6d3a9eec82b4
parent 440 88ed40ad0d4f
parent 498 afd134142111
child 559 c5fd2d996909
equal deleted inserted replaced
10:4c55da1ec689 14:a3302a0b5143
   927     > {
   927     > {
   928       static const bool value = true;
   928       static const bool value = true;
   929     };
   929     };
   930 
   930 
   931     template <typename Target, typename Source,
   931     template <typename Target, typename Source,
   932               bool buildEnable = BuildTagIndicator<Target>::value,
   932               bool buildEnable = BuildTagIndicator<Target>::value>
   933               bool revEnable = RevPathTagIndicator<Source>::value>
   933     struct PathCopySelectorForward {
   934     struct PathCopySelector {
       
   935       static void copy(Target& target, const Source& source) {
   934       static void copy(Target& target, const Source& source) {
   936         target.clear();
   935         target.clear();
   937         for (typename Source::ArcIt it(source); it != INVALID; ++it) {
   936         for (typename Source::ArcIt it(source); it != INVALID; ++it) {
   938           target.addBack(it);
   937           target.addBack(it);
   939         }
   938         }
   940       }
   939       }
   941     };
   940     };
   942 
   941 
   943     template <typename Target, typename Source>
   942     template <typename Target, typename Source>
   944     struct PathCopySelector<Target, Source, false, true> {
   943     struct PathCopySelectorForward<Target, Source, true> {
       
   944       static void copy(Target& target, const Source& source) {
       
   945         target.clear();
       
   946         target.build(source);
       
   947       }
       
   948     };
       
   949 
       
   950     template <typename Target, typename Source,
       
   951               bool buildEnable = BuildTagIndicator<Target>::value>
       
   952     struct PathCopySelectorBackward {
   945       static void copy(Target& target, const Source& source) {
   953       static void copy(Target& target, const Source& source) {
   946         target.clear();
   954         target.clear();
   947         for (typename Source::RevArcIt it(source); it != INVALID; ++it) {
   955         for (typename Source::RevArcIt it(source); it != INVALID; ++it) {
   948           target.addFront(it);
   956           target.addFront(it);
   949         }
   957         }
   950       }
   958       }
   951     };
   959     };
   952 
   960 
   953     template <typename Target, typename Source>
   961     template <typename Target, typename Source>
   954     struct PathCopySelector<Target, Source, true, false> {
   962     struct PathCopySelectorBackward<Target, Source, true> {
   955       static void copy(Target& target, const Source& source) {
       
   956         target.clear();
       
   957         target.build(source);
       
   958       }
       
   959     };
       
   960 
       
   961     template <typename Target, typename Source>
       
   962     struct PathCopySelector<Target, Source, true, true> {
       
   963       static void copy(Target& target, const Source& source) {
   963       static void copy(Target& target, const Source& source) {
   964         target.clear();
   964         target.clear();
   965         target.buildRev(source);
   965         target.buildRev(source);
   966       }
   966       }
       
   967     };
       
   968 
       
   969     
       
   970     template <typename Target, typename Source,
       
   971               bool revEnable = RevPathTagIndicator<Source>::value>
       
   972     struct PathCopySelector {
       
   973       static void copy(Target& target, const Source& source) {
       
   974         PathCopySelectorForward<Target, Source>::copy(target, source);
       
   975       }      
       
   976     };
       
   977 
       
   978     template <typename Target, typename Source>
       
   979     struct PathCopySelector<Target, Source, true> {
       
   980       static void copy(Target& target, const Source& source) {
       
   981         PathCopySelectorBackward<Target, Source>::copy(target, source);
       
   982       }      
   967     };
   983     };
   968 
   984 
   969   }
   985   }
   970 
   986 
   971 
   987