IODA Bundle
RowsCounter.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2012 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #include "eckit/eckit.h"
12 #include "odc/core/MetaData.h"
13 #include "odc/core/TablesReader.h"
14 #include "odc/Reader.h"
15 #include "odc/RowsCounter.h"
16 
17 using namespace eckit;
18 
19 namespace odc {
20 
21 unsigned long long RowsCounter::fastRowCount(const PathName &db)
22 {
23  unsigned long long n = 0;
24 
25  core::TablesReader reader(db);
26 
27  auto it = reader.begin();
28  auto end = reader.end();
29  for (; it != end; ++it)
30  n += it->rowCount();
31  return n;
32 }
33 
34 
35 } // namespace odc
36 
size_t rowCount() const
Definition: Table.cc:50
Definition: ColumnInfo.h:23