// -*- c++ -*- /*****************************************************************************/ // Copyright (c) Illumina 2008 // Author: Richard Shaw // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). /*****************************************************************************/ #ifndef INCREMENTAL_ACCUM_H #define INCREMENTAL_ACCUM_H /*****************************************************************************/ template class Incremental_Accum { public: Incremental_Accum(T initial_sum = 0) : my_sum(initial_sum) { } ~Incremental_Accum() { } const T operator()(const T val) { return (my_sum += val); } private: T my_sum; }; /*****************************************************************************/ #endif // ! INCREMENTAL_ACCUM_H /*****************************************************************************/