Commit 88d2aa18 authored by Philipp Götze's avatar Philipp Götze
Browse files

Removed obsolete PTuplePrinter + short comment on BDCCInfo

parent 98679b10
/*
* Copyright (c) 2014-17 The PipeFabric team,
* All Rights Reserved.
*
* This file is part of the PipeFabric package.
*
* PipeFabric is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License (GPL) as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This package is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file LICENSE.
* If not you can find the GPL at http://www.gnu.org/copyleft/gpl.html
*/
#ifndef PTuplePrinter_hpp_
#define PTuplePrinter_hpp_
#include <ostream>
#include <core/PTuple.hpp>
namespace pfabric {
/**
* Forward declarations
*/
namespace nvm {
template<class Tuple> class PTuple;
}
template<std::size_t ID, class Tuple>
auto get(const nvm::PTuple<Tuple>& ptp) -> typename Tuple::template getAttributeType<ID>::type;
namespace nvm {
namespace detail {
template<class Tuple, std::size_t CurrentIndex>
struct PTuplePrinter;
template<class Tuple, std::size_t CurrentIndex>
struct PTuplePrinter {
static void print(std::ostream& os, const nvm::PTuple<Tuple>& ptp) {
PTuplePrinter<Tuple, CurrentIndex - 1>::print(os, ptp);
os << "," << pfabric::get<CurrentIndex - 1>(ptp);
}
};
template<class Tuple>
struct PTuplePrinter<Tuple, 1> {
static void print(std::ostream& os, const nvm::PTuple<Tuple>& ptp) {
os << pfabric::get<0>(ptp);
}
};
template<class Tuple>
struct PTuplePrinter<Tuple, 0> {
static void print(std::ostream& os, const nvm::PTuple<Tuple>& ptp) {
}
};
} /* end namespace detail */
template<class Tuple>
void print(std::ostream& os, const nvm::PTuple<Tuple>& ptp) {
detail::PTuplePrinter<Tuple, ptp.NUM_ATTRIBUTES>::print(os, ptp);
}
} /* end namespace nvm */
} /* end namespace pfabric */
#endif /* PTuplePrinter_hpp_ */
......@@ -24,10 +24,14 @@
namespace pfabric {
/**************************************************************************//**
* \brief Info structure about the BDCC meta data.
*
* It is used in persistent tables to store the BDCC meta data and statistics.
*****************************************************************************/
struct BDCCInfo {
typedef std::unordered_map<ColumnInfo, uint16_t> ColumnBitsMap;
//BDCCInfo() {}
BDCCInfo(ColumnBitsMap _bitMap) : bitMap(_bitMap),
numBins(std::accumulate(_bitMap.begin(), _bitMap.end(), 0,
[](const size_t sum, decltype(*_bitMap.begin()) p) { return sum + p.second; })) {}
......@@ -35,9 +39,9 @@ struct BDCCInfo {
const ColumnBitsMap bitMap;
const size_t numBins;
std::map<uint32_t, std::size_t> histogram;
};
typedef std::shared_ptr<TableInfo> TableInfoPtr;
}
};/* struct BDCCInfo */
} /* namespace pfabric */
#endif
#endif /* PTuple_hpp_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment