Skip to content

Commit 0b3edad

Browse files
committed
🔥 Remove sc from flow and seq libraries
Problem: sc is superseded by stdx::ct_string functionality. Solution: Remove dependency on sc for some libraries.
1 parent a0eb6cd commit 0b3edad

File tree

5 files changed

+17
-34
lines changed

5 files changed

+17
-34
lines changed

CMakeLists.txt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ target_sources(
241241

242242
add_library(cib_flow INTERFACE)
243243
target_compile_features(cib_flow INTERFACE cxx_std_20)
244-
target_link_libraries_system(cib_flow INTERFACE cib_log cib_nexus cib_sc stdx)
244+
target_link_libraries_system(cib_flow INTERFACE cib_log cib_nexus stdx)
245245

246246
target_sources(
247247
cib_flow
@@ -266,14 +266,7 @@ target_sources(
266266

267267
add_library(cib_seq INTERFACE)
268268
target_compile_features(cib_seq INTERFACE cxx_std_20)
269-
target_link_libraries_system(
270-
cib_seq
271-
INTERFACE
272-
cib_flow
273-
cib_log
274-
cib_nexus
275-
cib_sc
276-
stdx)
269+
target_link_libraries_system(cib_seq INTERFACE cib_flow cib_log cib_nexus stdx)
277270

278271
target_sources(
279272
cib_seq

include/flow/graph_builder.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,10 @@ struct graph_builder {
169169

170170
template <typename T>
171171
constexpr static auto error_steps =
172-
stdx::transform([](auto N) { return stdx::ct_string_from_type(N); },
173-
T{})
174-
.join(stdx::ct_string{""}, [](auto x, auto y) {
175-
using namespace stdx::literals;
176-
return x + ", "_cts + y;
177-
});
172+
T{}.join(stdx::cts_t<"">{}, [](auto x, auto y) {
173+
using namespace stdx::literals;
174+
return x + ", "_ctst + y;
175+
});
178176

179177
constexpr static void check_for_missing_nodes(auto nodes,
180178
auto mentioned_nodes) {

include/flow/graphviz_builder.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ struct graphviz_builder {
2020
nodes_t sinks{};
2121
for_each(
2222
[&]<typename Node>(Node const &) {
23-
sources.insert(Node::name_t::value);
24-
sinks.insert(Node::name_t::value);
23+
sources.emplace(Node::name_t::value);
24+
sinks.emplace(Node::name_t::value);
2525
},
2626
nodes);
2727
for_each(
2828
[&]<typename Edge>(Edge const &) {
29-
sinks.erase(Edge::source_t::name_t::value);
30-
sources.erase(Edge::dest_t::name_t::value);
29+
sinks.erase(std::string_view{Edge::source_t::name_t::value});
30+
sources.erase(std::string_view{Edge::dest_t::name_t::value});
3131
},
3232
edges);
3333

@@ -39,9 +39,9 @@ struct graphviz_builder {
3939
}
4040
for_each(
4141
[&]<typename Edge>(Edge const &) {
42-
output += std::string{Edge::source_t::name_t::value};
42+
output += std::string_view{Edge::source_t::name_t::value};
4343
output += " -> ";
44-
output += std::string{Edge::dest_t::name_t::value};
44+
output += std::string_view{Edge::dest_t::name_t::value};
4545
output += '\n';
4646
},
4747
edges);

include/flow/step.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <flow/common.hpp>
66
#include <flow/log.hpp>
77
#include <flow/subgraph_identity.hpp>
8-
#include <sc/string_constant.hpp>
98

109
#include <stdx/compiler.hpp>
1110
#include <stdx/ct_string.hpp>
@@ -18,10 +17,7 @@ template <stdx::ct_string Type, stdx::ct_string Name,
1817
subgraph_identity Identity, typename Cond, typename F>
1918
struct ct_node {
2019
using is_subgraph = void;
21-
using type_t =
22-
decltype(stdx::ct_string_to_type<Type, sc::string_constant>());
23-
using name_t =
24-
decltype(stdx::ct_string_to_type<Name, sc::string_constant>());
20+
using name_t = stdx::cts_t<Name>;
2521
using func_t = F;
2622

2723
constexpr static auto ct_type = Type;

include/seq/step.hpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <cib/detail/runtime_conditional.hpp>
44
#include <flow/subgraph_identity.hpp>
55
#include <log/log.hpp>
6-
#include <sc/string_constant.hpp>
76

87
#include <stdx/ct_string.hpp>
98

@@ -31,8 +30,7 @@ struct rt_step {
3130
template <stdx::ct_string Name, bool IsReference = true>
3231
struct ct_step : rt_step {
3332
using is_subgraph = void;
34-
using name_t =
35-
decltype(stdx::ct_string_to_type<Name, sc::string_constant>());
33+
using name_t = stdx::cts_t<Name>;
3634

3735
constexpr static auto identity = flow::subgraph_identity::VALUE;
3836

@@ -56,10 +54,8 @@ struct ct_step : rt_step {
5654
*/
5755
template <stdx::ct_string Name>
5856
[[nodiscard]] constexpr auto step(func_ptr forward, func_ptr backward) {
59-
return ct_step<Name>{
60-
{forward, backward, [] {
61-
CIB_TRACE("seq.step({})",
62-
stdx::ct_string_to_type<Name, sc::string_constant>());
63-
}}};
57+
return ct_step<Name>{{forward, backward, [] {
58+
CIB_TRACE("seq.step({})", stdx::cts_t<Name>{});
59+
}}};
6460
}
6561
} // namespace seq

0 commit comments

Comments
 (0)