Buffer turn data on disk to save memory

This commit is contained in:
Patrick Niklaus
2017-04-09 13:59:55 +00:00
committed by Patrick Niklaus
parent 4e9e2ed5bd
commit 59bbfeb67f
7 changed files with 38 additions and 9 deletions
+6 -1
View File
@@ -6,6 +6,8 @@
#include "storage/shared_memory_ownership.hpp"
#include <stxxl/vector>
#include <boost/assert.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/iterator/reverse_iterator.hpp>
@@ -174,10 +176,13 @@ template <typename DataT> void swap(vector_view<DataT> &lhs, vector_view<DataT>
std::swap(lhs.m_size, rhs.m_size);
}
template <typename DataT, storage::Ownership Ownership>
using InternalOrExternalVector = typename std::conditional<Ownership == storage::Ownership::External, stxxl::vector<DataT>, std::vector<DataT>>::type;
template <typename DataT, storage::Ownership Ownership>
using ViewOrVector = typename std::conditional<Ownership == storage::Ownership::View,
vector_view<DataT>,
std::vector<DataT>>::type;
InternalOrExternalVector<DataT, Ownership>>::type;
}
}