2 * TemplateDataSourceUser.icpp
4 * Created on: Sep 23, 2015
7 * @copyright 2012-2020 Euclid Science Ground Segment
9 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
10 * Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option)
13 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17 * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #include <cstddef> // for std::size_t
27 double TemplatedDataSourceUser::sumRecords(const T& data_source) {
29 std::size_t records_number = data_source.countRecords();
30 for (std::size_t index = 0; index < records_number; ++index) {
31 sum += data_source.getRecordValue(index);
37 } // namespace Examples
38 } // namespace Elements