删除impl
This commit is contained in:
@@ -16,7 +16,7 @@ using namespace aethera::render_2d;
|
||||
|
||||
template <typename Object, typename... Arguments>
|
||||
Object* build_object(Arguments&&... arguments) {
|
||||
typename Object::Builder builder(std::forward<Arguments>(arguments)...);
|
||||
typename Object::template Builder<Object> builder(std::forward<Arguments>(arguments)...);
|
||||
auto result = builder.build();
|
||||
if (!result) std::_Exit(2);
|
||||
return std::move(result).value().release();
|
||||
@@ -34,13 +34,13 @@ bool contains_color(Image_View view) {
|
||||
}
|
||||
|
||||
int main() {
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Power = Impl<Numeric_Axis>;
|
||||
using Time = Impl<Time_Axis>;
|
||||
using Spectrum_Object = Impl<Spectrum>;
|
||||
using Constellation_Object = Impl<Constellation_Diagram>;
|
||||
using Waterfall_Object = Impl<Waterfall>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Power = Numeric_Axis;
|
||||
using Time = Time_Axis;
|
||||
using Spectrum_Object = Spectrum;
|
||||
using Constellation_Object = Constellation_Diagram;
|
||||
using Waterfall_Object = Waterfall;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
|
||||
initialize_runtime({.workers = 4});
|
||||
auto* frequency = build_object<Frequency>();
|
||||
@@ -67,7 +67,7 @@ int main() {
|
||||
power->paint_taskflow().add("test.power.paint.order",
|
||||
verify_spectrum_precedes_axis);
|
||||
|
||||
typename Scene_Object::Builder scene_builder;
|
||||
typename Scene_Object::template Builder<Scene_Object> scene_builder;
|
||||
scene_builder.add_renderable(spectrum);
|
||||
scene_builder.add_renderable(waterfall);
|
||||
scene_builder.add_renderable(constellation);
|
||||
|
||||
@@ -9,7 +9,7 @@ using namespace aethera;
|
||||
using namespace aethera::render_2d;
|
||||
template <typename Object>
|
||||
std::unique_ptr<Object> build_axis() {
|
||||
auto result = typename Object::Builder{}.build();
|
||||
auto result = typename Object::template Builder<Object>{}.build();
|
||||
if (!result) std::terminate();
|
||||
return std::move(result).value();
|
||||
}
|
||||
@@ -34,7 +34,7 @@ TEST(event_routing_rule, keeps_layered_targets_before_nearest_scored_targets) {
|
||||
EXPECT_EQ(targets, (std::vector<int>{1, 3, 4, 2}));
|
||||
}
|
||||
TEST(axis_dispatch, numeric_axis_public_shell_reads_final_private_state) {
|
||||
using Object = Impl<Numeric_Axis>;
|
||||
using Object = Numeric_Axis;
|
||||
auto axis = build_axis<Object>();
|
||||
axis->set<&Abs_Axis::Prop::position>(Point_F{10.0, 0.0});
|
||||
axis->set<&Abs_Axis::Prop::pixel_length>(200.0);
|
||||
@@ -53,7 +53,7 @@ TEST(axis_dispatch, numeric_axis_public_shell_reads_final_private_state) {
|
||||
EXPECT_DOUBLE_EQ(axis->pixel_to_coordinate(-40.0), 5.0);
|
||||
}
|
||||
TEST(axis_dispatch, point_conversion_uses_current_orientation) {
|
||||
using Object = Impl<Numeric_Axis>;
|
||||
using Object = Numeric_Axis;
|
||||
auto axis = build_axis<Object>();
|
||||
axis->set<&Abs_Axis::Prop::position>(Point_F{0.0, 20.0});
|
||||
axis->set<&Abs_Axis::Prop::pixel_length>(100.0);
|
||||
@@ -80,8 +80,8 @@ TEST(render_cache, copy_owns_independent_pixels) {
|
||||
EXPECT_TRUE(contains_color);
|
||||
}
|
||||
TEST(axis_render, scene_prepares_and_paints_uncached_axis_into_frame) {
|
||||
using Object = Impl<Numeric_Axis>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Object = Numeric_Axis;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
initialize_runtime({.workers = 2});
|
||||
auto axis = build_axis<Object>();
|
||||
auto scene = build_axis<Scene_Object>();
|
||||
@@ -114,8 +114,8 @@ TEST(axis_render, scene_prepares_and_paints_uncached_axis_into_frame) {
|
||||
EXPECT_TRUE(contains_color);
|
||||
}
|
||||
TEST(axis_event, numeric_axis_wheel_zoom_and_drag_update_authoritative_range) {
|
||||
using Object = Impl<Numeric_Axis>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Object = Numeric_Axis;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
initialize_runtime({.workers = 2});
|
||||
auto axis = build_axis<Object>();
|
||||
auto scene = build_axis<Scene_Object>();
|
||||
@@ -145,8 +145,8 @@ TEST(axis_event, numeric_axis_wheel_zoom_and_drag_update_authoritative_range) {
|
||||
EXPECT_EQ(axis->coordinate_range(), (Axis_Range{-0.4, 8.6}));
|
||||
}
|
||||
TEST(axis_event, scene_routes_pointer_interaction_to_the_nearest_axis_segment) {
|
||||
using Axis_Object = Impl<Numeric_Axis>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Axis_Object = Numeric_Axis;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
initialize_runtime({.workers = 2});
|
||||
auto horizontal = build_axis<Axis_Object>();
|
||||
auto vertical = build_axis<Axis_Object>();
|
||||
@@ -183,14 +183,14 @@ TEST(axis_event, scene_routes_pointer_interaction_to_the_nearest_axis_segment) {
|
||||
EXPECT_DOUBLE_EQ(vertical->coordinate_range().size(), 9.0);
|
||||
}
|
||||
TEST(axis_state, invalid_numeric_range_is_rejected_without_poisoning_pending_state) {
|
||||
using Object = Impl<Numeric_Axis>;
|
||||
using Object = Numeric_Axis;
|
||||
auto axis = build_axis<Object>();
|
||||
EXPECT_THROW((axis->set<&Numeric_Axis::Prop::coordinate_range>(Axis_Range{1.0, 1.0})), std::invalid_argument);
|
||||
axis->advance();
|
||||
EXPECT_EQ(axis->coordinate_range(), (Axis_Range{0.0, 20.0}));
|
||||
}
|
||||
TEST(axis_label, frequency_axis_selects_engineering_unit) {
|
||||
using Object = Impl<Frequency_Axis>;
|
||||
using Object = Frequency_Axis;
|
||||
auto axis = build_axis<Object>();
|
||||
axis->advance();
|
||||
EXPECT_EQ(axis->tick_label(250.0), "250 Hz");
|
||||
@@ -198,7 +198,7 @@ TEST(axis_label, frequency_axis_selects_engineering_unit) {
|
||||
EXPECT_EQ(axis->tick_label(2'500'000.0), "2.5 MHz");
|
||||
}
|
||||
TEST(axis_time, sample_state_drives_range_lookup_and_label_without_snapshot) {
|
||||
using Object = Impl<Time_Axis>;
|
||||
using Object = Time_Axis;
|
||||
auto axis = build_axis<Object>();
|
||||
EXPECT_EQ(axis->append_time({3'723'004}), 0);
|
||||
EXPECT_EQ(axis->time_point_count(), 0u);
|
||||
@@ -214,7 +214,7 @@ TEST(axis_time, sample_state_drives_range_lookup_and_label_without_snapshot) {
|
||||
EXPECT_FALSE(axis->tick_to_time(99).valid());
|
||||
}
|
||||
TEST(axis_time, appending_each_time_sample_invalidates_tick_preparation) {
|
||||
using Object = Impl<Time_Axis>;
|
||||
using Object = Time_Axis;
|
||||
auto axis = build_axis<Object>();
|
||||
axis->advance();
|
||||
axis->template take_dirty<Prepare_Data_Tag>();
|
||||
|
||||
@@ -16,7 +16,7 @@ using namespace aethera::render_2d;
|
||||
|
||||
template <typename Object, typename... Arguments>
|
||||
std::unique_ptr<Object> build_object(Arguments&&... arguments) {
|
||||
typename Object::Builder builder(std::forward<Arguments>(arguments)...);
|
||||
typename Object::template Builder<Object> builder(std::forward<Arguments>(arguments)...);
|
||||
auto result = builder.build();
|
||||
if (!result) std::terminate();
|
||||
return std::move(result).value();
|
||||
@@ -25,15 +25,15 @@ std::unique_ptr<Object> build_object(Arguments&&... arguments) {
|
||||
|
||||
TEST(partition_configuration,
|
||||
builder_and_runtime_share_the_authoritative_partition_properties) {
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Power = Impl<Numeric_Axis>;
|
||||
using Time = Impl<Time_Axis>;
|
||||
using Spectrum_Object = Impl<Spectrum>;
|
||||
using Trace_Object = Impl<Frequency_Trace>;
|
||||
using Sweep_Object = Impl<Sweep_Spectrum>;
|
||||
using Afterglow_Object = Impl<Afterglow>;
|
||||
using Constellation_Object = Impl<Constellation_Diagram>;
|
||||
using Waterfall_Object = Impl<Waterfall>;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Power = Numeric_Axis;
|
||||
using Time = Time_Axis;
|
||||
using Spectrum_Object = Spectrum;
|
||||
using Trace_Object = Frequency_Trace;
|
||||
using Sweep_Object = Sweep_Spectrum;
|
||||
using Afterglow_Object = Afterglow;
|
||||
using Constellation_Object = Constellation_Diagram;
|
||||
using Waterfall_Object = Waterfall;
|
||||
|
||||
auto frequency = build_object<Frequency>();
|
||||
auto power = build_object<Power>();
|
||||
|
||||
@@ -10,7 +10,7 @@ using namespace aethera::render_2d;
|
||||
|
||||
template <typename Object, typename... Args>
|
||||
std::unique_ptr<Object> build_object(Args&&... args) {
|
||||
typename Object::Builder builder(std::forward<Args>(args)...);
|
||||
typename Object::template Builder<Object> builder(std::forward<Args>(args)...);
|
||||
auto result = builder.build();
|
||||
if (!result) std::terminate();
|
||||
return std::move(result).value();
|
||||
@@ -18,7 +18,7 @@ std::unique_ptr<Object> build_object(Args&&... args) {
|
||||
|
||||
template <typename Scene, typename... Renderables>
|
||||
std::unique_ptr<Scene> build_scene(Renderables*... renderables) {
|
||||
typename Scene::Builder builder;
|
||||
typename Scene::template Builder<Scene> builder;
|
||||
(builder.add_renderable(renderables), ...);
|
||||
auto result = builder.build();
|
||||
if (!result) std::terminate();
|
||||
@@ -41,12 +41,12 @@ void render_once(Scene* scene) {
|
||||
}
|
||||
|
||||
TEST(plottable_migration, curve_plots_share_partitioned_rendering) {
|
||||
using Scene = Impl<Render_Scene_2D>;
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Numeric = Impl<Numeric_Axis>;
|
||||
using Time = Impl<Time_Axis>;
|
||||
using Trace = Impl<Frequency_Trace>;
|
||||
using Sweep = Impl<Sweep_Spectrum>;
|
||||
using Scene = Render_Scene_2D;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Numeric = Numeric_Axis;
|
||||
using Time = Time_Axis;
|
||||
using Trace = Frequency_Trace;
|
||||
using Sweep = Sweep_Spectrum;
|
||||
initialize_runtime({.workers = 2});
|
||||
const Size canvas{160, 120};
|
||||
auto frequency = build_object<Frequency>();
|
||||
@@ -104,12 +104,12 @@ TEST(plottable_migration, curve_plots_share_partitioned_rendering) {
|
||||
}
|
||||
|
||||
TEST(plottable_migration, raster_plots_share_partitioned_color_blocks) {
|
||||
using Scene = Impl<Render_Scene_2D>;
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Numeric = Impl<Numeric_Axis>;
|
||||
using Time = Impl<Time_Axis>;
|
||||
using Glow = Impl<Afterglow>;
|
||||
using Fall = Impl<Waterfall>;
|
||||
using Scene = Render_Scene_2D;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Numeric = Numeric_Axis;
|
||||
using Time = Time_Axis;
|
||||
using Glow = Afterglow;
|
||||
using Fall = Waterfall;
|
||||
initialize_runtime({.workers = 2});
|
||||
const Size canvas{160, 120};
|
||||
auto frequency = build_object<Frequency>();
|
||||
@@ -160,10 +160,10 @@ TEST(plottable_migration, raster_plots_share_partitioned_color_blocks) {
|
||||
}
|
||||
|
||||
TEST(plottable_migration, direct_overlay_and_constellation_build_and_render) {
|
||||
using Scene = Impl<Render_Scene_2D>;
|
||||
using Numeric = Impl<Numeric_Axis>;
|
||||
using Diagram = Impl<Constellation_Diagram>;
|
||||
using Overlay = Impl<Selection_Rectangle_Overlay>;
|
||||
using Scene = Render_Scene_2D;
|
||||
using Numeric = Numeric_Axis;
|
||||
using Diagram = Constellation_Diagram;
|
||||
using Overlay = Selection_Rectangle_Overlay;
|
||||
initialize_runtime({.workers = 2});
|
||||
const Size canvas{160, 120};
|
||||
auto horizontal = build_object<Numeric>();
|
||||
@@ -190,9 +190,9 @@ TEST(plottable_migration, direct_overlay_and_constellation_build_and_render) {
|
||||
}
|
||||
|
||||
TEST(selection_overlay, control_extends_selection_and_plain_click_clears_it) {
|
||||
using Scene = Impl<Render_Scene_2D>;
|
||||
using Numeric = Impl<Numeric_Axis>;
|
||||
using Overlay = Impl<Selection_Rectangle_Overlay>;
|
||||
using Scene = Render_Scene_2D;
|
||||
using Numeric = Numeric_Axis;
|
||||
using Overlay = Selection_Rectangle_Overlay;
|
||||
initialize_runtime({.workers = 2});
|
||||
const Size canvas{160, 120};
|
||||
auto horizontal = build_object<Numeric>();
|
||||
@@ -233,10 +233,10 @@ TEST(selection_overlay, control_extends_selection_and_plain_click_clears_it) {
|
||||
}
|
||||
|
||||
TEST(selection_overlay, time_axis_selection_keeps_axis_coordinates_while_window_moves) {
|
||||
using Scene = Impl<Render_Scene_2D>;
|
||||
using Time = Impl<Time_Axis>;
|
||||
using Numeric = Impl<Numeric_Axis>;
|
||||
using Overlay = Impl<Selection_Rectangle_Overlay>;
|
||||
using Scene = Render_Scene_2D;
|
||||
using Time = Time_Axis;
|
||||
using Numeric = Numeric_Axis;
|
||||
using Overlay = Selection_Rectangle_Overlay;
|
||||
initialize_runtime({.workers = 2});
|
||||
const Size canvas{160, 120};
|
||||
auto time = build_object<Time>();
|
||||
|
||||
@@ -7,14 +7,14 @@ using namespace aethera;
|
||||
using namespace aethera::render_2d;
|
||||
template <typename Object, typename... Args>
|
||||
std::unique_ptr<Object> build_object(Args&&... args) {
|
||||
typename Object::Builder builder(std::forward<Args>(args)...);
|
||||
typename Object::template Builder<Object> builder(std::forward<Args>(args)...);
|
||||
auto result = builder.build();
|
||||
if (!result) std::terminate();
|
||||
return std::move(result).value();
|
||||
}
|
||||
template <typename Scene, typename... Renderables>
|
||||
std::unique_ptr<Scene> build_scene(Renderables*... renderables) {
|
||||
typename Scene::Builder builder;
|
||||
typename Scene::template Builder<Scene> builder;
|
||||
(builder.add_renderable(renderables), ...);
|
||||
auto result = builder.build();
|
||||
if (!result) std::terminate();
|
||||
@@ -52,10 +52,10 @@ std::unique_ptr<Frame_2D> render_frame(Scene* scene) {
|
||||
}
|
||||
}
|
||||
TEST(spectrum_data, publishes_samples_through_tagged_frame_buffer) {
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Power = Impl<Numeric_Axis>;
|
||||
using Object = Impl<Spectrum>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Power = Numeric_Axis;
|
||||
using Object = Spectrum;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
auto frequency = build_object<Frequency>();
|
||||
auto power = build_object<Power>();
|
||||
auto spectrum = build_object<Object>(frequency.get(), power.get());
|
||||
@@ -69,10 +69,10 @@ TEST(spectrum_data, publishes_samples_through_tagged_frame_buffer) {
|
||||
(std::vector<Spectrum_Power>{-100.0, -50.0, 0.0}));
|
||||
}
|
||||
TEST(spectrum_markers, uses_tagged_properties_as_the_only_marker_interface) {
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Power = Impl<Numeric_Axis>;
|
||||
using Object = Impl<Spectrum>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Power = Numeric_Axis;
|
||||
using Object = Spectrum;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
auto frequency = build_object<Frequency>();
|
||||
auto power = build_object<Power>();
|
||||
auto spectrum = build_object<Object>(frequency.get(), power.get());
|
||||
@@ -103,10 +103,10 @@ TEST(spectrum_markers, uses_tagged_properties_as_the_only_marker_interface) {
|
||||
EXPECT_EQ(spectrum->read_prop<Spectrum::Base_Tag>().selected_marker, -1);
|
||||
}
|
||||
TEST(render_scene_2d, composites_axes_and_spectrum_into_final_frame) {
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Power = Impl<Numeric_Axis>;
|
||||
using Spectrum_Object = Impl<Spectrum>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Power = Numeric_Axis;
|
||||
using Spectrum_Object = Spectrum;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
initialize_runtime({.workers = 2});
|
||||
auto frequency = build_object<Frequency>();
|
||||
auto power = build_object<Power>();
|
||||
@@ -194,10 +194,10 @@ TEST(render_scene_2d, composites_axes_and_spectrum_into_final_frame) {
|
||||
}
|
||||
|
||||
TEST(spectrum_data, repeatedly_publishes_new_samples_during_long_running_render) {
|
||||
using Frequency = Impl<Frequency_Axis>;
|
||||
using Power = Impl<Numeric_Axis>;
|
||||
using Spectrum_Object = Impl<Spectrum>;
|
||||
using Scene_Object = Impl<Render_Scene_2D>;
|
||||
using Frequency = Frequency_Axis;
|
||||
using Power = Numeric_Axis;
|
||||
using Spectrum_Object = Spectrum;
|
||||
using Scene_Object = Render_Scene_2D;
|
||||
initialize_runtime({.workers = 4});
|
||||
auto frequency = build_object<Frequency>();
|
||||
auto power = build_object<Power>();
|
||||
|
||||
Reference in New Issue
Block a user