Skip to content

Commit

Permalink
Merge pull request #208 from tcbrindle/pr/source_reorg
Browse files Browse the repository at this point in the history
Reorganise source files
  • Loading branch information
tcbrindle authored Sep 6, 2024
2 parents cad6859 + d1ed599 commit 5412f51
Show file tree
Hide file tree
Showing 87 changed files with 468 additions and 524 deletions.
8 changes: 4 additions & 4 deletions benchmark/multidimensional_memset_benchmark_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <flux/op/cartesian_product.hpp>
#include <flux/source/iota.hpp>
#include <flux/op/for_each.hpp>
#include <flux/op/filter.hpp>
#include <flux/adaptor/cartesian_product.hpp>
#include <flux/sequence/iota.hpp>
#include <flux/algorithm/for_each.hpp>
#include <flux/adaptor/filter.hpp>

#if __cpp_lib_ranges_cartesian_product >= 202207L
#include <ranges>
Expand Down
75 changes: 3 additions & 72 deletions include/flux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,78 +6,9 @@
#ifndef FLUX_HPP_INCLUDED
#define FLUX_HPP_INCLUDED

#include <flux/adaptor.hpp>
#include <flux/algorithm.hpp>
#include <flux/core.hpp>

#include <flux/op/adjacent.hpp>
#include <flux/op/adjacent_filter.hpp>
#include <flux/op/all_any_none.hpp>
#include <flux/op/begin_end.hpp>
#include <flux/op/cache_last.hpp>
#include <flux/op/cartesian_base.hpp>
#include <flux/op/cartesian_power.hpp>
#include <flux/op/cartesian_power_map.hpp>
#include <flux/op/cartesian_product.hpp>
#include <flux/op/cartesian_product_map.hpp>
#include <flux/op/chain.hpp>
#include <flux/op/chunk.hpp>
#include <flux/op/chunk_by.hpp>
#include <flux/op/compare.hpp>
#include <flux/op/contains.hpp>
#include <flux/op/count.hpp>
#include <flux/op/cursors.hpp>
#include <flux/op/cycle.hpp>
#include <flux/op/drop.hpp>
#include <flux/op/drop_while.hpp>
#include <flux/op/ends_with.hpp>
#include <flux/op/equal.hpp>
#include <flux/op/fill.hpp>
#include <flux/op/filter.hpp>
#include <flux/op/filter_map.hpp>
#include <flux/op/find.hpp>
#include <flux/op/find_min_max.hpp>
#include <flux/op/flatten.hpp>
#include <flux/op/flatten_with.hpp>
#include <flux/op/fold.hpp>
#include <flux/op/for_each.hpp>
#include <flux/op/for_each_while.hpp>
#include <flux/op/from.hpp>
#include <flux/op/inplace_reverse.hpp>
#include <flux/op/map.hpp>
#include <flux/op/mask.hpp>
#include <flux/op/minmax.hpp>
#include <flux/op/read_only.hpp>
#include <flux/op/ref.hpp>
#include <flux/op/reverse.hpp>
#include <flux/op/scan.hpp>
#include <flux/op/scan_first.hpp>
#include <flux/op/set_adaptors.hpp>
#include <flux/op/slice.hpp>
#include <flux/op/slide.hpp>
#include <flux/op/sort.hpp>
#include <flux/op/split.hpp>
#include <flux/op/split_string.hpp>
#include <flux/op/starts_with.hpp>
#include <flux/op/stride.hpp>
#include <flux/op/swap_elements.hpp>
#include <flux/op/take.hpp>
#include <flux/op/take_while.hpp>
#include <flux/op/to.hpp>
#include <flux/op/unchecked.hpp>
#include <flux/op/write_to.hpp>
#include <flux/op/zip.hpp>
#include <flux/op/zip_algorithms.hpp>

#include <flux/source/array_ptr.hpp>
#include <flux/source/bitset.hpp>
#include <flux/source/empty.hpp>
#include <flux/source/generator.hpp>
#include <flux/source/getlines.hpp>
#include <flux/source/iota.hpp>
#include <flux/source/istream.hpp>
#include <flux/source/istreambuf.hpp>
#include <flux/source/range.hpp>
#include <flux/source/repeat.hpp>
#include <flux/source/single.hpp>
#include <flux/source/unfold.hpp>
#include <flux/sequence.hpp>

#endif
44 changes: 44 additions & 0 deletions include/flux/adaptor.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

// Copyright (c) 2024 Tristan Brindle (tcbrindle at gmail dot com)
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_ADAPTOR_HPP_INCLUDED
#define FLUX_ADAPTOR_HPP_INCLUDED

#include <flux/adaptor/adjacent.hpp>
#include <flux/adaptor/adjacent_filter.hpp>
#include <flux/adaptor/cache_last.hpp>
#include <flux/adaptor/cartesian_base.hpp>
#include <flux/adaptor/cartesian_power.hpp>
#include <flux/adaptor/cartesian_power_map.hpp>
#include <flux/adaptor/cartesian_product.hpp>
#include <flux/adaptor/cartesian_product_map.hpp>
#include <flux/adaptor/chain.hpp>
#include <flux/adaptor/chunk.hpp>
#include <flux/adaptor/chunk_by.hpp>
#include <flux/adaptor/cursors.hpp>
#include <flux/adaptor/cycle.hpp>
#include <flux/adaptor/drop.hpp>
#include <flux/adaptor/drop_while.hpp>
#include <flux/adaptor/filter.hpp>
#include <flux/adaptor/filter_map.hpp>
#include <flux/adaptor/flatten.hpp>
#include <flux/adaptor/flatten_with.hpp>
#include <flux/adaptor/map.hpp>
#include <flux/adaptor/mask.hpp>
#include <flux/adaptor/read_only.hpp>
#include <flux/adaptor/reverse.hpp>
#include <flux/adaptor/scan.hpp>
#include <flux/adaptor/scan_first.hpp>
#include <flux/adaptor/set_adaptors.hpp>
#include <flux/adaptor/slide.hpp>
#include <flux/adaptor/split.hpp>
#include <flux/adaptor/split_string.hpp>
#include <flux/adaptor/stride.hpp>
#include <flux/adaptor/take.hpp>
#include <flux/adaptor/take_while.hpp>
#include <flux/adaptor/unchecked.hpp>
#include <flux/adaptor/zip.hpp>

#endif // FLUX_ADAPTOR_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_ADJACENT_HPP_INCLUDED
#define FLUX_OP_ADJACENT_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_ADJACENT_HPP_INCLUDED
#define FLUX_ADAPTOR_ADJACENT_HPP_INCLUDED

#include <flux/core.hpp>

#include <flux/op/begin_end.hpp>
#include <flux/op/reverse.hpp>
#include <flux/op/requirements.hpp>
#include <flux/op/zip.hpp>
#include <flux/source/iota.hpp>
#include <flux/adaptor/reverse.hpp>
#include <flux/adaptor/zip.hpp>
#include <flux/sequence/iota.hpp>

#include <array>

Expand Down Expand Up @@ -277,4 +275,4 @@ constexpr auto inline_sequence_base<D>::pairwise_map(Func func) &&

} // namespace flux

#endif // FLUX_OP_ADJACENT_HPP_INCLUDED
#endif // FLUX_ADAPTOR_ADJACENT_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_ADJACENT_FILTER_HPP_INCLUDED
#define FLUX_OP_ADJACENT_FILTER_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_ADJACENT_FILTER_HPP_INCLUDED
#define FLUX_ADAPTOR_ADJACENT_FILTER_HPP_INCLUDED

#include <flux/core.hpp>

Expand Down Expand Up @@ -160,4 +160,4 @@ constexpr auto inline_sequence_base<D>::dedup() &&

} // namespace flux

#endif // FLUX_OP_ADJACENT_FILTER_HPP_INCLUDED
#endif // FLUX_ADAPTOR_ADJACENT_FILTER_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CACHE_LAST_HPP_INCLUDED
#define FLUX_OP_CACHE_LAST_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CACHE_LAST_HPP_INCLUDED
#define FLUX_ADAPTOR_CACHE_LAST_HPP_INCLUDED

#include <flux/core.hpp>
#include <flux/op/from.hpp>

namespace flux {

Expand All @@ -20,7 +19,7 @@ struct cache_last_adaptor : inline_sequence_base<cache_last_adaptor<Base>>
Base base_;
flux::optional<cursor_t<Base>> cached_last_{};

friend struct passthrough_traits_base<Base>;
friend struct passthrough_traits_base;

constexpr auto base() -> Base& { return base_; }

Expand All @@ -29,7 +28,7 @@ struct cache_last_adaptor : inline_sequence_base<cache_last_adaptor<Base>>
: base_(FLUX_FWD(base))
{}

struct flux_sequence_traits : detail::passthrough_traits_base<Base> {
struct flux_sequence_traits : detail::passthrough_traits_base {

using value_type = value_t<Base>;
using self_t = cache_last_adaptor;
Expand Down Expand Up @@ -89,4 +88,4 @@ constexpr auto inline_sequence_base<Derived>::cache_last() &&

} // namespace flux

#endif // FLUX_OP_CACHE_LAST_HPP_INCLUDED
#endif // FLUX_ADAPTOR_CACHE_LAST_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_CARTESIAN_BASE_HPP_INCLUDED
#define FLUX_CARTESIAN_BASE_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CARTESIAN_BASE_HPP_INCLUDED
#define FLUX_ADAPTOR_CARTESIAN_BASE_HPP_INCLUDED

#include <flux/core.hpp>

namespace flux::detail {

Expand Down Expand Up @@ -406,4 +408,4 @@ struct cartesian_traits_base<Arity, CartesianKind, read_kind::tuple, Bases...> :

}

#endif //FLUX_CARTESIAN_BASE_HPP_INCLUDED
#endif //FLUX_ADAPTOR_CARTESIAN_BASE_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CARTESIAN_POWER_HPP_INCLUDED
#define FLUX_OP_CARTESIAN_POWER_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CARTESIAN_POWER_HPP_INCLUDED
#define FLUX_ADAPTOR_CARTESIAN_POWER_HPP_INCLUDED

#include <flux/core.hpp>
#include <flux/core/numeric.hpp>
#include <flux/op/from.hpp>
#include <flux/op/cartesian_base.hpp>
#include <flux/adaptor/cartesian_base.hpp>

#include <tuple>

Expand Down Expand Up @@ -68,5 +67,4 @@ inline constexpr auto cartesian_power = detail::cartesian_power_fn<N>{};

} // end namespace flux

#endif

#endif // FLUX_ADAPTOR_CARTESIAN_POWER_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CARTESIAN_POWER_MAP_HPP_INCLUDED
#define FLUX_OP_CARTESIAN_POWER_MAP_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CARTESIAN_POWER_MAP_HPP_INCLUDED
#define FLUX_ADAPTOR_CARTESIAN_POWER_MAP_HPP_INCLUDED

#include <flux/op/cartesian_base.hpp>
#include <flux/op/requirements.hpp>
#include <flux/adaptor/cartesian_base.hpp>

namespace flux {

Expand Down Expand Up @@ -62,4 +61,4 @@ inline constexpr auto cartesian_power_map = detail::cartesian_power_map_fn<N>{};

} // namespace flux

#endif
#endif // FLUX_ADAPTOR_CARTESIAN_POWER_MAP_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CARTESIAN_PRODUCT_HPP_INCLUDED
#define FLUX_OP_CARTESIAN_PRODUCT_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CARTESIAN_PRODUCT_HPP_INCLUDED
#define FLUX_ADAPTOR_CARTESIAN_PRODUCT_HPP_INCLUDED

#include <flux/core.hpp>
#include <flux/core/numeric.hpp>
#include <flux/op/from.hpp>
#include <flux/op/cartesian_base.hpp>
#include <flux/adaptor/cartesian_base.hpp>

#include <tuple>

Expand Down Expand Up @@ -57,5 +56,4 @@ FLUX_EXPORT inline constexpr auto cartesian_product = detail::cartesian_product_

} // end namespace flux

#endif

#endif // FLUX_ADAPTOR_CARTESIAN_PRODUCT_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
#define FLUX_OP_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
#define FLUX_ADAPTOR_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED

#include <flux/op/cartesian_base.hpp>
#include <flux/adaptor/cartesian_base.hpp>

namespace flux {

Expand Down Expand Up @@ -55,4 +55,4 @@ FLUX_EXPORT inline constexpr auto cartesian_product_map = detail::cartesian_prod

} // namespace flux

#endif
#endif // FLUX_ADAPTOR_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
6 changes: 3 additions & 3 deletions include/flux/op/chain.hpp → include/flux/adaptor/chain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CHAIN_HPP_INCLUDED
#define FLUX_OP_CHAIN_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CHAIN_HPP_INCLUDED
#define FLUX_ADAPTOR_CHAIN_HPP_INCLUDED

#include <flux/core.hpp>

Expand Down Expand Up @@ -327,4 +327,4 @@ FLUX_EXPORT inline constexpr auto chain = detail::chain_fn{};

} // namespace flux

#endif
#endif // FLUX_ADAPTOR_CHAIN_HPP_INCLUDED
11 changes: 5 additions & 6 deletions include/flux/op/chunk.hpp → include/flux/adaptor/chunk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CHUNK_HPP_INCLUDED
#define FLUX_OP_CHUNK_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CHUNK_HPP_INCLUDED
#define FLUX_ADAPTOR_CHUNK_HPP_INCLUDED

#include <flux/core.hpp>

#include <flux/op/slice.hpp>
#include <flux/op/stride.hpp>
#include <flux/op/take.hpp>
#include <flux/adaptor/stride.hpp>
#include <flux/adaptor/take.hpp>

namespace flux {

Expand Down Expand Up @@ -319,4 +318,4 @@ constexpr auto inline_sequence_base<D>::chunk(num::integral auto chunk_sz) &&

} // namespace flux

#endif // FLUX_OP_CHUNK_HPP_INCLUDED
#endif // FLUX_ADAPTOR_CHUNK_HPP_INCLUDED
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef FLUX_OP_CHUNK_BY_HPP_INCLUDED
#define FLUX_OP_CHUNK_BY_HPP_INCLUDED
#ifndef FLUX_ADAPTOR_CHUNK_BY_HPP_INCLUDED
#define FLUX_ADAPTOR_CHUNK_BY_HPP_INCLUDED

#include <flux/core.hpp>
#include <flux/op/slice.hpp>

namespace flux {

Expand Down Expand Up @@ -146,4 +145,4 @@ constexpr auto inline_sequence_base<Derived>::chunk_by(Pred pred) &&

} // namespace flux

#endif
#endif // FLUX_ADAPTOR_CHUNK_BY_HPP_INCLUDED
Loading

0 comments on commit 5412f51

Please sign in to comment.