/**************************************************************************** * Copyright (c) 2023 by the ArborX authors * * All rights reserved. * * * * This file is part of the ArborX library. ArborX is * * distributed under a BSD 3-clause license. For the licensing terms see * * the LICENSE file in the top-level directory. * * * * SPDX-License-Identifier: BSD-3-Clause * ****************************************************************************/ #ifndef ARBORX_TEST_LEGACY_TREE_HPP #define ARBORX_TEST_LEGACY_TREE_HPP #include template class LegacyTree : public Tree { public: LegacyTree() = default; template LegacyTree(ExecutionSpace const &space, Primitives const &primitives) : Tree(space, ArborX::Details::LegacyValues{ primitives}) {} template void query(ExecutionSpace const &space, Predicates const &predicates, Callback const &callback) const { Tree::query(space, predicates, callback); } template std::enable_if_t>> query(ExecutionSpace const &space, Predicates const &predicates, View &&view, Args &&...args) const { Tree::query(space, predicates, ArborX::Details::LegacyDefaultCallback{}, std::forward(view), std::forward(args)...); } template std::enable_if_t>> query(ExecutionSpace const &space, Predicates const &predicates, Callback &&callback, OutputView &&out, OffsetView &&offset, Args &&...args) const { if constexpr (!ArborX::Details::is_tagged_post_callback< std::decay_t>::value) { Tree::query( space, predicates, ArborX::Details::LegacyCallbackWrapper>{ std::forward(callback)}, std::forward(out), std::forward(offset), std::forward(args)...); } else { Kokkos::View indices( "Testing::indices", 0); Tree::query(space, predicates, ArborX::Details::LegacyDefaultCallback{}, indices, std::forward(offset), std::forward(args)...); callback(predicates, std::forward(offset), indices, std::forward(out)); } } }; #endif