Skip to content

Commit 5412f51

Browse files
authored
Merge pull request #208 from tcbrindle/pr/source_reorg
Reorganise source files
2 parents cad6859 + d1ed599 commit 5412f51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+468
-524
lines changed

benchmark/multidimensional_memset_benchmark_kernels.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
// Distributed under the Boost Software License, Version 1.0. (See accompanying
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7-
#include <flux/op/cartesian_product.hpp>
8-
#include <flux/source/iota.hpp>
9-
#include <flux/op/for_each.hpp>
10-
#include <flux/op/filter.hpp>
7+
#include <flux/adaptor/cartesian_product.hpp>
8+
#include <flux/sequence/iota.hpp>
9+
#include <flux/algorithm/for_each.hpp>
10+
#include <flux/adaptor/filter.hpp>
1111

1212
#if __cpp_lib_ranges_cartesian_product >= 202207L
1313
#include <ranges>

include/flux.hpp

+3-72
Original file line numberDiff line numberDiff line change
@@ -6,78 +6,9 @@
66
#ifndef FLUX_HPP_INCLUDED
77
#define FLUX_HPP_INCLUDED
88

9+
#include <flux/adaptor.hpp>
10+
#include <flux/algorithm.hpp>
911
#include <flux/core.hpp>
10-
11-
#include <flux/op/adjacent.hpp>
12-
#include <flux/op/adjacent_filter.hpp>
13-
#include <flux/op/all_any_none.hpp>
14-
#include <flux/op/begin_end.hpp>
15-
#include <flux/op/cache_last.hpp>
16-
#include <flux/op/cartesian_base.hpp>
17-
#include <flux/op/cartesian_power.hpp>
18-
#include <flux/op/cartesian_power_map.hpp>
19-
#include <flux/op/cartesian_product.hpp>
20-
#include <flux/op/cartesian_product_map.hpp>
21-
#include <flux/op/chain.hpp>
22-
#include <flux/op/chunk.hpp>
23-
#include <flux/op/chunk_by.hpp>
24-
#include <flux/op/compare.hpp>
25-
#include <flux/op/contains.hpp>
26-
#include <flux/op/count.hpp>
27-
#include <flux/op/cursors.hpp>
28-
#include <flux/op/cycle.hpp>
29-
#include <flux/op/drop.hpp>
30-
#include <flux/op/drop_while.hpp>
31-
#include <flux/op/ends_with.hpp>
32-
#include <flux/op/equal.hpp>
33-
#include <flux/op/fill.hpp>
34-
#include <flux/op/filter.hpp>
35-
#include <flux/op/filter_map.hpp>
36-
#include <flux/op/find.hpp>
37-
#include <flux/op/find_min_max.hpp>
38-
#include <flux/op/flatten.hpp>
39-
#include <flux/op/flatten_with.hpp>
40-
#include <flux/op/fold.hpp>
41-
#include <flux/op/for_each.hpp>
42-
#include <flux/op/for_each_while.hpp>
43-
#include <flux/op/from.hpp>
44-
#include <flux/op/inplace_reverse.hpp>
45-
#include <flux/op/map.hpp>
46-
#include <flux/op/mask.hpp>
47-
#include <flux/op/minmax.hpp>
48-
#include <flux/op/read_only.hpp>
49-
#include <flux/op/ref.hpp>
50-
#include <flux/op/reverse.hpp>
51-
#include <flux/op/scan.hpp>
52-
#include <flux/op/scan_first.hpp>
53-
#include <flux/op/set_adaptors.hpp>
54-
#include <flux/op/slice.hpp>
55-
#include <flux/op/slide.hpp>
56-
#include <flux/op/sort.hpp>
57-
#include <flux/op/split.hpp>
58-
#include <flux/op/split_string.hpp>
59-
#include <flux/op/starts_with.hpp>
60-
#include <flux/op/stride.hpp>
61-
#include <flux/op/swap_elements.hpp>
62-
#include <flux/op/take.hpp>
63-
#include <flux/op/take_while.hpp>
64-
#include <flux/op/to.hpp>
65-
#include <flux/op/unchecked.hpp>
66-
#include <flux/op/write_to.hpp>
67-
#include <flux/op/zip.hpp>
68-
#include <flux/op/zip_algorithms.hpp>
69-
70-
#include <flux/source/array_ptr.hpp>
71-
#include <flux/source/bitset.hpp>
72-
#include <flux/source/empty.hpp>
73-
#include <flux/source/generator.hpp>
74-
#include <flux/source/getlines.hpp>
75-
#include <flux/source/iota.hpp>
76-
#include <flux/source/istream.hpp>
77-
#include <flux/source/istreambuf.hpp>
78-
#include <flux/source/range.hpp>
79-
#include <flux/source/repeat.hpp>
80-
#include <flux/source/single.hpp>
81-
#include <flux/source/unfold.hpp>
12+
#include <flux/sequence.hpp>
8213

8314
#endif

include/flux/adaptor.hpp

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
// Copyright (c) 2024 Tristan Brindle (tcbrindle at gmail dot com)
3+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
4+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5+
6+
#ifndef FLUX_ADAPTOR_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_HPP_INCLUDED
8+
9+
#include <flux/adaptor/adjacent.hpp>
10+
#include <flux/adaptor/adjacent_filter.hpp>
11+
#include <flux/adaptor/cache_last.hpp>
12+
#include <flux/adaptor/cartesian_base.hpp>
13+
#include <flux/adaptor/cartesian_power.hpp>
14+
#include <flux/adaptor/cartesian_power_map.hpp>
15+
#include <flux/adaptor/cartesian_product.hpp>
16+
#include <flux/adaptor/cartesian_product_map.hpp>
17+
#include <flux/adaptor/chain.hpp>
18+
#include <flux/adaptor/chunk.hpp>
19+
#include <flux/adaptor/chunk_by.hpp>
20+
#include <flux/adaptor/cursors.hpp>
21+
#include <flux/adaptor/cycle.hpp>
22+
#include <flux/adaptor/drop.hpp>
23+
#include <flux/adaptor/drop_while.hpp>
24+
#include <flux/adaptor/filter.hpp>
25+
#include <flux/adaptor/filter_map.hpp>
26+
#include <flux/adaptor/flatten.hpp>
27+
#include <flux/adaptor/flatten_with.hpp>
28+
#include <flux/adaptor/map.hpp>
29+
#include <flux/adaptor/mask.hpp>
30+
#include <flux/adaptor/read_only.hpp>
31+
#include <flux/adaptor/reverse.hpp>
32+
#include <flux/adaptor/scan.hpp>
33+
#include <flux/adaptor/scan_first.hpp>
34+
#include <flux/adaptor/set_adaptors.hpp>
35+
#include <flux/adaptor/slide.hpp>
36+
#include <flux/adaptor/split.hpp>
37+
#include <flux/adaptor/split_string.hpp>
38+
#include <flux/adaptor/stride.hpp>
39+
#include <flux/adaptor/take.hpp>
40+
#include <flux/adaptor/take_while.hpp>
41+
#include <flux/adaptor/unchecked.hpp>
42+
#include <flux/adaptor/zip.hpp>
43+
44+
#endif // FLUX_ADAPTOR_HPP_INCLUDED

include/flux/op/adjacent.hpp include/flux/adaptor/adjacent.hpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_ADJACENT_HPP_INCLUDED
7-
#define FLUX_OP_ADJACENT_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_ADJACENT_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_ADJACENT_HPP_INCLUDED
88

99
#include <flux/core.hpp>
1010

11-
#include <flux/op/begin_end.hpp>
12-
#include <flux/op/reverse.hpp>
13-
#include <flux/op/requirements.hpp>
14-
#include <flux/op/zip.hpp>
15-
#include <flux/source/iota.hpp>
11+
#include <flux/adaptor/reverse.hpp>
12+
#include <flux/adaptor/zip.hpp>
13+
#include <flux/sequence/iota.hpp>
1614

1715
#include <array>
1816

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

278276
} // namespace flux
279277

280-
#endif // FLUX_OP_ADJACENT_HPP_INCLUDED
278+
#endif // FLUX_ADAPTOR_ADJACENT_HPP_INCLUDED

include/flux/op/adjacent_filter.hpp include/flux/adaptor/adjacent_filter.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_ADJACENT_FILTER_HPP_INCLUDED
7-
#define FLUX_OP_ADJACENT_FILTER_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_ADJACENT_FILTER_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_ADJACENT_FILTER_HPP_INCLUDED
88

99
#include <flux/core.hpp>
1010

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

161161
} // namespace flux
162162

163-
#endif // FLUX_OP_ADJACENT_FILTER_HPP_INCLUDED
163+
#endif // FLUX_ADAPTOR_ADJACENT_FILTER_HPP_INCLUDED

include/flux/op/cache_last.hpp include/flux/adaptor/cache_last.hpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_CACHE_LAST_HPP_INCLUDED
7-
#define FLUX_OP_CACHE_LAST_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_CACHE_LAST_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_CACHE_LAST_HPP_INCLUDED
88

99
#include <flux/core.hpp>
10-
#include <flux/op/from.hpp>
1110

1211
namespace flux {
1312

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

23-
friend struct passthrough_traits_base<Base>;
22+
friend struct passthrough_traits_base;
2423

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

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

32-
struct flux_sequence_traits : detail::passthrough_traits_base<Base> {
31+
struct flux_sequence_traits : detail::passthrough_traits_base {
3332

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

9089
} // namespace flux
9190

92-
#endif // FLUX_OP_CACHE_LAST_HPP_INCLUDED
91+
#endif // FLUX_ADAPTOR_CACHE_LAST_HPP_INCLUDED

include/flux/op/cartesian_base.hpp include/flux/adaptor/cartesian_base.hpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8-
#ifndef FLUX_CARTESIAN_BASE_HPP_INCLUDED
9-
#define FLUX_CARTESIAN_BASE_HPP_INCLUDED
8+
#ifndef FLUX_ADAPTOR_CARTESIAN_BASE_HPP_INCLUDED
9+
#define FLUX_ADAPTOR_CARTESIAN_BASE_HPP_INCLUDED
10+
11+
#include <flux/core.hpp>
1012

1113
namespace flux::detail {
1214

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

407409
}
408410

409-
#endif //FLUX_CARTESIAN_BASE_HPP_INCLUDED
411+
#endif //FLUX_ADAPTOR_CARTESIAN_BASE_HPP_INCLUDED

include/flux/op/cartesian_power.hpp include/flux/adaptor/cartesian_power.hpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8-
#ifndef FLUX_OP_CARTESIAN_POWER_HPP_INCLUDED
9-
#define FLUX_OP_CARTESIAN_POWER_HPP_INCLUDED
8+
#ifndef FLUX_ADAPTOR_CARTESIAN_POWER_HPP_INCLUDED
9+
#define FLUX_ADAPTOR_CARTESIAN_POWER_HPP_INCLUDED
1010

1111
#include <flux/core.hpp>
1212
#include <flux/core/numeric.hpp>
13-
#include <flux/op/from.hpp>
14-
#include <flux/op/cartesian_base.hpp>
13+
#include <flux/adaptor/cartesian_base.hpp>
1514

1615
#include <tuple>
1716

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

6968
} // end namespace flux
7069

71-
#endif
72-
70+
#endif // FLUX_ADAPTOR_CARTESIAN_POWER_HPP_INCLUDED

include/flux/op/cartesian_power_map.hpp include/flux/adaptor/cartesian_power_map.hpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_CARTESIAN_POWER_MAP_HPP_INCLUDED
7-
#define FLUX_OP_CARTESIAN_POWER_MAP_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_CARTESIAN_POWER_MAP_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_CARTESIAN_POWER_MAP_HPP_INCLUDED
88

9-
#include <flux/op/cartesian_base.hpp>
10-
#include <flux/op/requirements.hpp>
9+
#include <flux/adaptor/cartesian_base.hpp>
1110

1211
namespace flux {
1312

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

6362
} // namespace flux
6463

65-
#endif
64+
#endif // FLUX_ADAPTOR_CARTESIAN_POWER_MAP_HPP_INCLUDED

include/flux/op/cartesian_product.hpp include/flux/adaptor/cartesian_product.hpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

8-
#ifndef FLUX_OP_CARTESIAN_PRODUCT_HPP_INCLUDED
9-
#define FLUX_OP_CARTESIAN_PRODUCT_HPP_INCLUDED
8+
#ifndef FLUX_ADAPTOR_CARTESIAN_PRODUCT_HPP_INCLUDED
9+
#define FLUX_ADAPTOR_CARTESIAN_PRODUCT_HPP_INCLUDED
1010

1111
#include <flux/core.hpp>
1212
#include <flux/core/numeric.hpp>
13-
#include <flux/op/from.hpp>
14-
#include <flux/op/cartesian_base.hpp>
13+
#include <flux/adaptor/cartesian_base.hpp>
1514

1615
#include <tuple>
1716

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

5857
} // end namespace flux
5958

60-
#endif
61-
59+
#endif // FLUX_ADAPTOR_CARTESIAN_PRODUCT_HPP_INCLUDED

include/flux/op/cartesian_product_map.hpp include/flux/adaptor/cartesian_product_map.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
7-
#define FLUX_OP_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED
88

9-
#include <flux/op/cartesian_base.hpp>
9+
#include <flux/adaptor/cartesian_base.hpp>
1010

1111
namespace flux {
1212

@@ -55,4 +55,4 @@ FLUX_EXPORT inline constexpr auto cartesian_product_map = detail::cartesian_prod
5555

5656
} // namespace flux
5757

58-
#endif
58+
#endif // FLUX_ADAPTOR_CARTESIAN_PRODUCT_MAP_HPP_INCLUDED

include/flux/op/chain.hpp include/flux/adaptor/chain.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_CHAIN_HPP_INCLUDED
7-
#define FLUX_OP_CHAIN_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_CHAIN_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_CHAIN_HPP_INCLUDED
88

99
#include <flux/core.hpp>
1010

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

328328
} // namespace flux
329329

330-
#endif
330+
#endif // FLUX_ADAPTOR_CHAIN_HPP_INCLUDED

include/flux/op/chunk.hpp include/flux/adaptor/chunk.hpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_CHUNK_HPP_INCLUDED
7-
#define FLUX_OP_CHUNK_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_CHUNK_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_CHUNK_HPP_INCLUDED
88

99
#include <flux/core.hpp>
1010

11-
#include <flux/op/slice.hpp>
12-
#include <flux/op/stride.hpp>
13-
#include <flux/op/take.hpp>
11+
#include <flux/adaptor/stride.hpp>
12+
#include <flux/adaptor/take.hpp>
1413

1514
namespace flux {
1615

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

320319
} // namespace flux
321320

322-
#endif // FLUX_OP_CHUNK_HPP_INCLUDED
321+
#endif // FLUX_ADAPTOR_CHUNK_HPP_INCLUDED

include/flux/op/chunk_by.hpp include/flux/adaptor/chunk_by.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
// Distributed under the Boost Software License, Version 1.0. (See accompanying
44
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
55

6-
#ifndef FLUX_OP_CHUNK_BY_HPP_INCLUDED
7-
#define FLUX_OP_CHUNK_BY_HPP_INCLUDED
6+
#ifndef FLUX_ADAPTOR_CHUNK_BY_HPP_INCLUDED
7+
#define FLUX_ADAPTOR_CHUNK_BY_HPP_INCLUDED
88

99
#include <flux/core.hpp>
10-
#include <flux/op/slice.hpp>
1110

1211
namespace flux {
1312

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

147146
} // namespace flux
148147

149-
#endif
148+
#endif // FLUX_ADAPTOR_CHUNK_BY_HPP_INCLUDED

0 commit comments

Comments
 (0)