00001 /*************************************************************************** 00002 splitter.h - description 00003 ------------------- 00004 begin : Fri Feb 2 2007 00005 copyright : (C) 2001 by Thies Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef RECOSPLITTER_H 00019 #define RECOSPLITTER_H 00020 00021 00022 #include "step.h" 00023 00024 00025 /* 00026 * Template class to split data in one or more dimensions and to feed it separately 00027 * into the remaining part of the pipeline. 00028 * The rank of the unmodified collected data dimensions is is given by 'Nunmod'. 00029 * The particular unmodified dimension are given in 'Unmod' by a specialization of 'RecoDim'. 00030 * The numer of dimensions to split is given in 'Nsplit' and specified in 'Split' by 00031 * a specialization of 'RecoDim'. 00032 * The dimensions to split are expected leftmost in the input data array. 00033 */ 00034 template<unsigned int Nunmod, class Unmod, unsigned int Nsplit, class Split> 00035 class RecoSplitter : public RecoStep, public Labeled { 00036 00037 public: 00038 RecoSplitter(const STD_string& split_label) : Labeled(split_label) {} 00039 00040 private: 00041 00042 // implementing virtual functions of RecoStep 00043 STD_string label() const {return get_label();} 00044 STD_string description() const {return "Split data in one or more dimensions";} 00045 bool process(RecoData& rd, RecoController& controller); 00046 RecoCoord input_coord() const {RecoCoord result=Unmod::preset_coord(RecoIndex::collected); Split::modify(RecoIndex::collected,result); return result;} 00047 void modify_coord(RecoCoord& coord) const {Split::modify(RecoIndex::separate,coord);} 00048 RecoStep* allocate() const {return new RecoSplitter(get_label());} 00049 void init() {} 00050 00051 }; 00052 00053 00054 00055 #endif 00056
1.5.6