diff --git a/examples/app_helpers/app_audio.h b/examples/app_helpers/app_audio.h index fa95603..66505ed 100644 --- a/examples/app_helpers/app_audio.h +++ b/examples/app_helpers/app_audio.h @@ -1,8 +1,15 @@ #pragma once +#include +#include #include #include "basic_radio/basic_radio.h" +#include "basic_radio/basic_audio_channel.h" +#include "basic_radio/basic_audio_params.h" +#include "dab/database/dab_database_types.h" +#include "utility/span.h" #include "../audio/audio_pipeline.h" +#include "../audio/frame.h" static void attach_audio_pipeline_to_radio(std::shared_ptr audio_pipeline, BasicRadio& basic_radio) { if (audio_pipeline == nullptr) return; diff --git a/examples/app_helpers/app_common_gui.cpp b/examples/app_helpers/app_common_gui.cpp index c59fbd4..702ae60 100644 --- a/examples/app_helpers/app_common_gui.cpp +++ b/examples/app_helpers/app_common_gui.cpp @@ -1,5 +1,6 @@ #include "./app_common_gui.h" #include +#include #include #define IMGUI_DEFINE_MATH_OPERATORS #include diff --git a/examples/app_helpers/app_common_gui.h b/examples/app_helpers/app_common_gui.h index 84f8e3c..08bd028 100644 --- a/examples/app_helpers/app_common_gui.h +++ b/examples/app_helpers/app_common_gui.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #include struct CommonGui { diff --git a/examples/app_helpers/app_io_buffers.h b/examples/app_helpers/app_io_buffers.h index 5f5f5f7..ca8050f 100644 --- a/examples/app_helpers/app_io_buffers.h +++ b/examples/app_helpers/app_io_buffers.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include #include diff --git a/examples/app_helpers/app_ofdm_blocks.h b/examples/app_helpers/app_ofdm_blocks.h index 55cf778..9e8e5a1 100644 --- a/examples/app_helpers/app_ofdm_blocks.h +++ b/examples/app_helpers/app_ofdm_blocks.h @@ -1,15 +1,15 @@ #pragma once #include +#include #include #include #include #include "utility/span.h" -#include "ofdm/ofdm_demodulator.h" +#include "ofdm/dab_mapper_ref.h" #include "ofdm/dab_ofdm_params_ref.h" #include "ofdm/dab_prs_ref.h" -#include "ofdm/dab_mapper_ref.h" -#include "ofdm/ofdm_helpers.h" +#include "ofdm/ofdm_demodulator.h" #include "viterbi_config.h" #include "./app_io_buffers.h" diff --git a/examples/app_helpers/app_radio_blocks.h b/examples/app_helpers/app_radio_blocks.h index c26d213..e6cdcb4 100644 --- a/examples/app_helpers/app_radio_blocks.h +++ b/examples/app_helpers/app_radio_blocks.h @@ -1,9 +1,11 @@ #pragma once -#include +#include #include +#include #include "basic_radio/basic_radio.h" #include "dab/constants/dab_parameters.h" +#include "viterbi_config.h" #include "./app_io_buffers.h" class Basic_Radio_Block diff --git a/examples/app_helpers/app_viterbi_convert_block.h b/examples/app_helpers/app_viterbi_convert_block.h index 3714370..16ba135 100644 --- a/examples/app_helpers/app_viterbi_convert_block.h +++ b/examples/app_helpers/app_viterbi_convert_block.h @@ -1,7 +1,11 @@ #pragma once #include +#include +#include #include +#include +#include "utility/span.h" #include "viterbi_config.h" #include "./app_io_buffers.h" diff --git a/examples/apply_frequency_shift.cpp b/examples/apply_frequency_shift.cpp index ed6eac0..5b200d8 100644 --- a/examples/apply_frequency_shift.cpp +++ b/examples/apply_frequency_shift.cpp @@ -1,7 +1,11 @@ -#include #define _USE_MATH_DEFINES #include +#include +#include #include +#include +#include +#include #include #include "utility/span.h" diff --git a/examples/audio/audio_pipeline.cpp b/examples/audio/audio_pipeline.cpp index 8c71ca1..25a7642 100644 --- a/examples/audio/audio_pipeline.cpp +++ b/examples/audio/audio_pipeline.cpp @@ -1,8 +1,16 @@ #include "./audio_pipeline.h" #include +#include +#include #include #include #include +#include +#include +#include +#include +#include "utility/span.h" +#include "./frame.h" template static void audio_map_with_callback(tcb::span> src, tcb::span> dest, F&& func) { diff --git a/examples/audio/audio_pipeline.h b/examples/audio/audio_pipeline.h index 50a72ea..aeb08a8 100644 --- a/examples/audio/audio_pipeline.h +++ b/examples/audio/audio_pipeline.h @@ -1,15 +1,16 @@ #pragma once +#include +#include #include #include #include #include -#include +#include #include -#include +#include "utility/span.h" #include "./frame.h" #include "./ring_buffer.h" -#include "utility/span.h" constexpr float DEFAULT_AUDIO_SAMPLE_RATE = 48000.0f; constexpr float DEFAULT_AUDIO_SINK_DURATION = 0.1f; diff --git a/examples/audio/portaudio_sink.cpp b/examples/audio/portaudio_sink.cpp index 8250026..34be6ec 100644 --- a/examples/audio/portaudio_sink.cpp +++ b/examples/audio/portaudio_sink.cpp @@ -1,6 +1,13 @@ #include "./portaudio_sink.h" #include #include +#include +#include +#include +#include +#include +#include "utility/span.h" +#include "./frame.h" #if _WIN32 constexpr PaHostApiTypeId PORTAUDIO_TARGET_HOST_API_ID = PaHostApiTypeId::paDirectSound; diff --git a/examples/audio/portaudio_sink.h b/examples/audio/portaudio_sink.h index 90aec67..ea9b527 100644 --- a/examples/audio/portaudio_sink.h +++ b/examples/audio/portaudio_sink.h @@ -1,10 +1,11 @@ #pragma once -#include +#include +#include #include +#include #include -#include "utility/span.h" -#include "./frame.h" +#include #include "./audio_pipeline.h" // Create this once before all port audio code diff --git a/examples/basic_radio_app.cpp b/examples/basic_radio_app.cpp index 06d0670..164a397 100644 --- a/examples/basic_radio_app.cpp +++ b/examples/basic_radio_app.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -12,28 +13,33 @@ #endif #include -#include -#include "basic_radio/basic_radio.h" +#include #include "basic_radio/basic_audio_channel.h" +#include "basic_radio/basic_radio.h" #include "basic_scraper/basic_scraper.h" +#include "dab/constants/dab_parameters.h" +#include "dab/database/dab_database_types.h" +#include "viterbi_config.h" #include "./app_helpers/app_io_buffers.h" +#include "./app_helpers/app_logging.h" #include "./app_helpers/app_ofdm_blocks.h" #include "./app_helpers/app_radio_blocks.h" #include "./app_helpers/app_viterbi_convert_block.h" -#include "./app_helpers/app_logging.h" #if !BUILD_COMMAND_LINE -#include "./app_helpers/app_audio.h" -#include "./audio/audio_pipeline.h" -#include "./audio/portaudio_sink.h" #define IMGUI_DEFINE_MATH_OPERATORS #include +#include +#include +#include "./app_helpers/app_audio.h" #include "./app_helpers/app_common_gui.h" -#include "./gui/ofdm/render_ofdm_demod.h" -#include "./gui/ofdm/render_profiler.h" +#include "./audio/audio_pipeline.h" +#include "./audio/portaudio_sink.h" +#include "./gui/audio/render_portaudio_controls.h" #include "./gui/basic_radio/basic_radio_view_controller.h" #include "./gui/basic_radio/render_basic_radio.h" -#include "./gui/audio/render_portaudio_controls.h" +#include "./gui/ofdm/render_ofdm_demod.h" +#include "./gui/ofdm/render_profiler.h" #endif void init_parser(argparse::ArgumentParser& parser) { diff --git a/examples/convert_viterbi.cpp b/examples/convert_viterbi.cpp index beac614..f50da76 100644 --- a/examples/convert_viterbi.cpp +++ b/examples/convert_viterbi.cpp @@ -1,7 +1,11 @@ +#include #include #include +#include #include +#include #include +#include #if _WIN32 #include @@ -9,8 +13,9 @@ #endif #include -#include "dab/constants/dab_parameters.h" +#include "utility/span.h" #include "viterbi_config.h" +#include "./app_helpers/app_io_buffers.h" #include "./app_helpers/app_viterbi_convert_block.h" void init_parser(argparse::ArgumentParser& parser) { diff --git a/examples/device/device.cpp b/examples/device/device.cpp index 7ae7d59..c880dca 100644 --- a/examples/device/device.cpp +++ b/examples/device/device.cpp @@ -4,9 +4,16 @@ extern "C" { #include } -#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include "utility/span.h" Device::Device(rtlsdr_dev_t* device, const DeviceDescriptor& descriptor, const int block_size) : m_descriptor(descriptor), m_device(device), m_block_size(block_size) diff --git a/examples/device/device.h b/examples/device/device.h index 3ce0c0d..fe338a2 100644 --- a/examples/device/device.h +++ b/examples/device/device.h @@ -1,13 +1,13 @@ #pragma once +#include +#include +#include #include #include -#include -#include #include #include #include -#include #include "utility/span.h" struct DeviceDescriptor { diff --git a/examples/device/device_list.cpp b/examples/device/device_list.cpp index e46916d..cf9e2b4 100644 --- a/examples/device/device_list.cpp +++ b/examples/device/device_list.cpp @@ -1,8 +1,14 @@ #include "./device_list.h" +#include #include #include #include +#include +#include +#include +#include +#include "./device.h" extern "C" { #include diff --git a/examples/device/device_list.h b/examples/device/device_list.h index 94c2f1a..76ec29c 100644 --- a/examples/device/device_list.h +++ b/examples/device/device_list.h @@ -1,13 +1,11 @@ #pragma once -#include -#include +#include #include #include #include - -#include "./device.h" #include "utility/span.h" +#include "./device.h" class DeviceList { diff --git a/examples/gui/audio/render_portaudio_controls.cpp b/examples/gui/audio/render_portaudio_controls.cpp index 8546f6d..3c0cdaa 100644 --- a/examples/gui/audio/render_portaudio_controls.cpp +++ b/examples/gui/audio/render_portaudio_controls.cpp @@ -1,6 +1,9 @@ #include "./render_portaudio_controls.h" #define IMGUI_DEFINE_MATH_OPERATORS #include +#include +#include +#include "audio/audio_pipeline.h" #include "audio/portaudio_sink.h" void RenderPortAudioControls(PortAudioThreadedActions& actions, std::shared_ptr pipeline) { diff --git a/examples/gui/audio/render_portaudio_controls.h b/examples/gui/audio/render_portaudio_controls.h index f179d40..9f344e1 100644 --- a/examples/gui/audio/render_portaudio_controls.h +++ b/examples/gui/audio/render_portaudio_controls.h @@ -1,13 +1,16 @@ #pragma once -#include #include #include #include #include #include -#include "audio/portaudio_sink.h" +#include +#include +#include #include "audio/audio_pipeline.h" +#include "audio/portaudio_sink.h" +#include "utility/span.h" class ThreadedRunner { diff --git a/examples/gui/basic_radio/CMakeLists.txt b/examples/gui/basic_radio/CMakeLists.txt index a436771..b8062df 100644 --- a/examples/gui/basic_radio/CMakeLists.txt +++ b/examples/gui/basic_radio/CMakeLists.txt @@ -13,5 +13,4 @@ add_library(basic_radio_gui STATIC set_target_properties(basic_radio_gui PROPERTIES CXX_STANDARD 17) target_include_directories(basic_radio_gui PRIVATE ${SRC_DIR} ${ROOT_DIR} ${EXAMPLES_DIR}) target_include_directories(basic_radio_gui PRIVATE ${CMAKE_SOURCE_DIR}/vendor/stb ${SRC_DIR}/../) -target_compile_definitions(basic_radio_gui PRIVATE ELPP_THREAD_SAFE) -target_link_libraries(basic_radio_gui PRIVATE basic_radio imgui easyloggingpp fmt) \ No newline at end of file +target_link_libraries(basic_radio_gui PRIVATE basic_radio imgui fmt) \ No newline at end of file diff --git a/examples/gui/basic_radio/basic_radio_view_controller.cpp b/examples/gui/basic_radio/basic_radio_view_controller.cpp index f1e29b2..214b445 100644 --- a/examples/gui/basic_radio/basic_radio_view_controller.cpp +++ b/examples/gui/basic_radio/basic_radio_view_controller.cpp @@ -1,8 +1,13 @@ #include "./basic_radio_view_controller.h" -#include "basic_radio/basic_radio.h" -#include "basic_radio/basic_slideshow.h" #define IMGUI_DEFINE_MATH_OPERATORS #include +#include +#include +#include +#include "dab/database/dab_database_types.h" +#include "dab/mot/MOT_entities.h" +#include "utility/span.h" +#include "./texture.h" BasicRadioViewController::BasicRadioViewController(const size_t _max_textures) { textures.set_max_size(_max_textures); diff --git a/examples/gui/basic_radio/basic_radio_view_controller.h b/examples/gui/basic_radio/basic_radio_view_controller.h index d6b3441..125bde0 100644 --- a/examples/gui/basic_radio/basic_radio_view_controller.h +++ b/examples/gui/basic_radio/basic_radio_view_controller.h @@ -1,13 +1,13 @@ #pragma once +#include #include -#include #include #include -#include "utility/span.h" -#include "utility/lru_cache.h" +#include "dab/database/dab_database_types.h" #include "dab/mot/MOT_entities.h" -#include "dab/database/dab_database_entities.h" +#include "utility/lru_cache.h" +#include "utility/span.h" #include "./texture.h" struct Basic_Slideshow; diff --git a/examples/gui/basic_radio/formatters.cpp b/examples/gui/basic_radio/formatters.cpp index 85e172b..8b32c70 100644 --- a/examples/gui/basic_radio/formatters.cpp +++ b/examples/gui/basic_radio/formatters.cpp @@ -1,10 +1,14 @@ #include "./formatters.h" -#include - -#include "dab/constants/subchannel_protection_tables.h" +#include +#include +#include +#include "dab/audio/aac_frame_processor.h" #include "dab/constants/country_table.h" #include "dab/constants/language_table.h" #include "dab/constants/programme_type_table.h" +#include "dab/constants/subchannel_protection_tables.h" +#include "dab/database/dab_database_entities.h" +#include "dab/database/dab_database_types.h" std::string GetSubchannelProtectionLabel(const Subchannel& subchannel) { if (subchannel.is_uep) { @@ -20,7 +24,6 @@ uint32_t GetSubchannelBitrate(const Subchannel& subchannel) { const auto descriptor = GetUEPDescriptor(subchannel); return descriptor.bitrate; } - return CalculateEEPBitrate(subchannel); } @@ -98,6 +101,6 @@ const char* GetMPEGSurroundString(MPEG_Surround mpeg) { return "MPEG Surround RFA"; case MPEG_Surround::NOT_USED: default: - return NULL; + return "Unknown"; } } \ No newline at end of file diff --git a/examples/gui/basic_radio/formatters.h b/examples/gui/basic_radio/formatters.h index 8ff509e..5ae24c1 100644 --- a/examples/gui/basic_radio/formatters.h +++ b/examples/gui/basic_radio/formatters.h @@ -1,7 +1,10 @@ #pragma once -#include "dab/database/dab_database_entities.h" +#include +#include #include "dab/audio/aac_frame_processor.h" +#include "dab/database/dab_database_entities.h" +#include "dab/database/dab_database_types.h" std::string GetSubchannelProtectionLabel(const Subchannel& subchannel); uint32_t GetSubchannelBitrate(const Subchannel& subchannel); diff --git a/examples/gui/basic_radio/render_basic_radio.cpp b/examples/gui/basic_radio/render_basic_radio.cpp index 25a860d..5c86fcd 100644 --- a/examples/gui/basic_radio/render_basic_radio.cpp +++ b/examples/gui/basic_radio/render_basic_radio.cpp @@ -1,28 +1,28 @@ #include "./render_common.h" - #define IMGUI_DEFINE_MATH_OPERATORS #include -#include - -#include #include -#include +#include +#include #include -#include "../font_awesome_definitions.h" -#include "./formatters.h" -#include "./render_basic_radio.h" -#include "./basic_radio_view_controller.h" - -#include "basic_radio/basic_radio.h" -#include "basic_radio/basic_slideshow.h" -#include "basic_radio/basic_data_packet_channel.h" +#include +#include +#include +#include +#include #include "basic_radio/basic_audio_channel.h" -#include "basic_radio/basic_dab_plus_channel.h" #include "basic_radio/basic_dab_channel.h" +#include "basic_radio/basic_dab_plus_channel.h" +#include "basic_radio/basic_data_packet_channel.h" +#include "basic_radio/basic_radio.h" +#include "basic_radio/basic_slideshow.h" #include "dab/database/dab_database.h" #include "dab/database/dab_database_entities.h" #include "dab/database/dab_database_types.h" -#include "dab/database/dab_database_updater.h" +#include "../font_awesome_definitions.h" +#include "./basic_radio_view_controller.h" +#include "./formatters.h" +#include "./render_basic_radio.h" template static T* find_by_callback(std::vector& vec, F&& func) { diff --git a/examples/gui/basic_radio/render_common.cpp b/examples/gui/basic_radio/render_common.cpp index 7500c5b..3d4d3d9 100644 --- a/examples/gui/basic_radio/render_common.cpp +++ b/examples/gui/basic_radio/render_common.cpp @@ -1,15 +1,17 @@ -#include "./render_common.h" #include "./basic_radio_view_controller.h" - #define IMGUI_DEFINE_MATH_OPERATORS #include -#include -#include "basic_radio/basic_radio.h" +#include +#include +#include #include "basic_radio/basic_audio_channel.h" +#include "basic_radio/basic_radio.h" +#include "dab/dab_misc_info.h" #include "dab/database/dab_database.h" +#include "dab/database/dab_database_entities.h" #include "dab/database/dab_database_updater.h" -#include "dab/dab_misc_info.h" #include "./formatters.h" +#include "./render_common.h" template static T* find_by_callback(std::vector& vec, F&& func) { @@ -74,7 +76,7 @@ void RenderSubchannels(BasicRadio& radio) { ImGui::TextWrapped("%u kb/s", bitrate_kbps); auto* dab_plus_channel = radio.Get_Audio_Channel(subchannel.id); - if (dab_plus_channel != NULL) { + if (dab_plus_channel != nullptr) { auto& controls = dab_plus_channel->GetControls(); const bool is_selected = controls.GetAllEnabled(); ImGui::SameLine(); diff --git a/examples/gui/basic_radio/texture.cpp b/examples/gui/basic_radio/texture.cpp index 841485e..ae5b373 100644 --- a/examples/gui/basic_radio/texture.cpp +++ b/examples/gui/basic_radio/texture.cpp @@ -1,19 +1,18 @@ #include "./texture.h" - #include +#include +#include #include - +#include "utility/span.h" +#if __APPLE__ +#include +#else #if _WIN32 #define WIN32_LEAN_AND_MEAN #include #endif - -#if __APPLE__ -#include -#else #include #endif -#include #define STB_IMAGE_IMPLEMENTATION #define STBI_ONLY_PNG diff --git a/examples/gui/device/render_devices.cpp b/examples/gui/device/render_devices.cpp index 5df4d95..a9d4153 100644 --- a/examples/gui/device/render_devices.cpp +++ b/examples/gui/device/render_devices.cpp @@ -1,9 +1,14 @@ #include "./render_devices.h" - #define IMGUI_DEFINE_MATH_OPERATORS #include -#include +#include +#include +#include +#include #include +#include +#include +#include #include "device/device.h" #include "device/device_list.h" diff --git a/examples/gui/ofdm/render_ofdm_demod.cpp b/examples/gui/ofdm/render_ofdm_demod.cpp index 8a2ced9..316fd08 100644 --- a/examples/gui/ofdm/render_ofdm_demod.cpp +++ b/examples/gui/ofdm/render_ofdm_demod.cpp @@ -1,12 +1,15 @@ #include "./render_ofdm_demod.h" -#include "./render_profiler.h" -#include "ofdm/ofdm_demodulator.h" - #define IMGUI_DEFINE_MATH_OPERATORS #include #include +#include +#include #include +#include #include +#include "ofdm/ofdm_demodulator.h" +#include "utility/span.h" +#include "viterbi_config.h" static void CalculateMagnitude(tcb::span> fft_buf, tcb::span mag_buf, const float scale=20.0f); static void RenderControls(OFDM_Demod& demod); @@ -200,7 +203,7 @@ void RenderDemodulatedSymbols(const OFDM_Demod& demod) { if (ImPlot::BeginPlot("Phase error", ImVec2(-1,0))) { const auto A = (double)SOFT_DECISION_VITERBI_HIGH; ImPlot::SetupAxisLimits(ImAxis_X1, -A, A, ImPlotCond_Once); - ImPlot::SetupAxis(ImAxis_Y1, NULL, ImPlotAxisFlags_AutoFit); + ImPlot::SetupAxis(ImAxis_Y1, nullptr, ImPlotAxisFlags_AutoFit); const int x_range = 2*SOFT_DECISION_VITERBI_HIGH+1; const int x_step = 4; diff --git a/examples/gui/ofdm/render_profiler.cpp b/examples/gui/ofdm/render_profiler.cpp index af9b029..9bc1782 100644 --- a/examples/gui/ofdm/render_profiler.cpp +++ b/examples/gui/ofdm/render_profiler.cpp @@ -1,10 +1,14 @@ #include "./render_profiler.h" #include "ofdm/profiler.h" - #define IMGUI_DEFINE_MATH_OPERATORS #include -#include #include +#include +#include +#include +#include +#include +#include static void RenderTrace(const InstrumentorThread::profile_trace_t& trace); static void RenderLoggedTraces(const InstrumentorThread::profile_trace_logger_t& traces); diff --git a/examples/loop_file.cpp b/examples/loop_file.cpp index d7d0606..4bc3c8d 100644 --- a/examples/loop_file.cpp +++ b/examples/loop_file.cpp @@ -1,8 +1,9 @@ -#include #include +#include +#include +#include +#include #include -#include -#include "utility/span.h" #if _WIN32 #include diff --git a/examples/radio_app.cpp b/examples/radio_app.cpp index 339a039..3f72ec4 100644 --- a/examples/radio_app.cpp +++ b/examples/radio_app.cpp @@ -2,37 +2,46 @@ #include #include #include +#include #include #include +#include #include +#include #include +#include #include +#include #define IMGUI_DEFINE_MATH_OPERATORS #include #include -#include -#include "basic_radio/basic_radio.h" +#include +#include +#include #include "basic_radio/basic_audio_channel.h" +#include "basic_radio/basic_radio.h" #include "basic_scraper/basic_scraper.h" -#include "./block_frequencies.h" -#include "./app_helpers/app_io_buffers.h" -#include "./app_helpers/app_ofdm_blocks.h" -#include "./app_helpers/app_radio_blocks.h" -#include "./app_helpers/app_viterbi_convert_block.h" +#include "dab/constants/dab_parameters.h" +#include "dab/database/dab_database_types.h" +#include "utility/span.h" +#include "viterbi_config.h" #include "./app_helpers/app_audio.h" #include "./app_helpers/app_common_gui.h" +#include "./app_helpers/app_io_buffers.h" #include "./app_helpers/app_logging.h" +#include "./app_helpers/app_ofdm_blocks.h" #include "./audio/audio_pipeline.h" #include "./audio/portaudio_sink.h" +#include "./block_frequencies.h" #include "./device/device.h" #include "./device/device_list.h" -#include "./gui/ofdm/render_ofdm_demod.h" -#include "./gui/ofdm/render_profiler.h" -#include "./gui/basic_radio/render_basic_radio.h" -#include "./gui/basic_radio/basic_radio_view_controller.h" #include "./gui/audio/render_portaudio_controls.h" +#include "./gui/basic_radio/basic_radio_view_controller.h" +#include "./gui/basic_radio/render_basic_radio.h" #include "./gui/device/render_devices.h" +#include "./gui/ofdm/render_ofdm_demod.h" +#include "./gui/ofdm/render_profiler.h" void init_parser(argparse::ArgumentParser& parser) { parser.add_argument("--input") diff --git a/examples/read_wav.cpp b/examples/read_wav.cpp index 5eaf3c3..fd19f8f 100644 --- a/examples/read_wav.cpp +++ b/examples/read_wav.cpp @@ -1,8 +1,10 @@ -#include #include -#include +#include #include -#include "utility/span.h" +#include +#include +#include +#include #if _WIN32 #include diff --git a/examples/rtl_sdr.cpp b/examples/rtl_sdr.cpp index 3e2ad15..8941d12 100644 --- a/examples/rtl_sdr.cpp +++ b/examples/rtl_sdr.cpp @@ -16,16 +16,17 @@ * along with this program. If not, see . */ -#include -#include -#include +#include #include #include - -#include -#include +#include #include +#include +#include +#include #include +#include +#include #if _WIN32 #define WIN32_LEAN_AND_MEAN @@ -33,6 +34,8 @@ #include #include #include +#else +#include #endif #include diff --git a/examples/simulate_transmitter.cpp b/examples/simulate_transmitter.cpp index 2d5638e..772bca1 100644 --- a/examples/simulate_transmitter.cpp +++ b/examples/simulate_transmitter.cpp @@ -1,7 +1,9 @@ +#include #include -#define _USE_MATH_DEFINES -#include #include +#include +#include +#include #include #include "utility/span.h" @@ -11,12 +13,12 @@ #endif #include -#include "ofdm/ofdm_modulator.h" -#include "ofdm/ofdm_params.h" -#include "ofdm/dab_prs_ref.h" -#include "ofdm/dab_ofdm_params_ref.h" #include "ofdm/dab_mapper_ref.h" +#include "ofdm/dab_ofdm_params_ref.h" +#include "ofdm/dab_prs_ref.h" #include "ofdm/dsp/apply_pll.h" +#include "ofdm/ofdm_modulator.h" +#include "ofdm/ofdm_params.h" // scrambler that is used for DVB transmissions class Scrambler diff --git a/src/basic_radio/basic_audio_channel.cpp b/src/basic_radio/basic_audio_channel.cpp index 48de93d..e3ef0ed 100644 --- a/src/basic_radio/basic_audio_channel.cpp +++ b/src/basic_radio/basic_audio_channel.cpp @@ -1,14 +1,10 @@ #include "./basic_audio_channel.h" -#include "./basic_slideshow.h" +#include +#include +#include "dab/constants/dab_parameters.h" #include "dab/database/dab_database_entities.h" #include "dab/msc/msc_decoder.h" -#include "dab/mot/MOT_slideshow_processor.h" -#include - -#include -#include "./basic_radio_logging.h" -#define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) -#define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) +#include "./basic_slideshow.h" Basic_Audio_Channel::Basic_Audio_Channel(const DAB_Parameters& params, const Subchannel subchannel, const AudioServiceType audio_service_type) : m_params(params), m_subchannel(subchannel), m_audio_service_type(audio_service_type) { diff --git a/src/basic_radio/basic_audio_channel.h b/src/basic_radio/basic_audio_channel.h index 34f2183..25f96d2 100644 --- a/src/basic_radio/basic_audio_channel.h +++ b/src/basic_radio/basic_audio_channel.h @@ -1,14 +1,12 @@ #pragma once #include +#include #include #include -#include -#include - -#include "./basic_msc_runner.h" -#include "./basic_audio_params.h" #include "./basic_audio_controls.h" +#include "./basic_audio_params.h" +#include "./basic_msc_runner.h" #include "dab/constants/dab_parameters.h" #include "dab/database/dab_database_entities.h" #include "utility/observable.h" diff --git a/src/basic_radio/basic_audio_controls.cpp b/src/basic_radio/basic_audio_controls.cpp index 78fd679..e6b1f69 100644 --- a/src/basic_radio/basic_audio_controls.cpp +++ b/src/basic_radio/basic_audio_controls.cpp @@ -1,4 +1,5 @@ #include "./basic_audio_controls.h" +#include // controls constexpr uint8_t CONTROL_FLAG_DECODE_AUDIO = 0b10000000; diff --git a/src/basic_radio/basic_dab_channel.cpp b/src/basic_radio/basic_dab_channel.cpp index 54c8717..ff10282 100644 --- a/src/basic_radio/basic_dab_channel.cpp +++ b/src/basic_radio/basic_dab_channel.cpp @@ -1,20 +1,27 @@ #include "./basic_dab_channel.h" -#include "./basic_slideshow.h" -#include "basic_audio_channel.h" -#include "dab/audio/mp2_audio_decoder.h" -#include "dab/pad/pad_processor.h" -#include "dab/msc/msc_decoder.h" -#include "dab/mot/MOT_slideshow_processor.h" - -#include +#include #include #include -#include +#include +#include +#include +#include +#include +#include "dab/audio/mp2_audio_decoder.h" +#include "dab/constants/dab_parameters.h" +#include "dab/database/dab_database_entities.h" +#include "dab/msc/msc_decoder.h" +#include "dab/pad/pad_processor.h" +#include "utility/span.h" +#include "viterbi_config.h" +#include "./basic_audio_channel.h" +#include "./basic_audio_params.h" #include "./basic_radio_logging.h" +#include "./basic_slideshow.h" #define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) -#undef min -#undef max +#undef min // NOLINT +#undef max // NOLINT Basic_DAB_Channel::Basic_DAB_Channel(const DAB_Parameters& params, const Subchannel subchannel, const AudioServiceType audio_service_type) : Basic_Audio_Channel(params, subchannel, audio_service_type) diff --git a/src/basic_radio/basic_dab_channel.h b/src/basic_radio/basic_dab_channel.h index 76b67d7..702fb25 100644 --- a/src/basic_radio/basic_dab_channel.h +++ b/src/basic_radio/basic_dab_channel.h @@ -1,10 +1,15 @@ #pragma once -#include "./basic_audio_channel.h" -#include -#include #include +#include #include +#include +#include "dab/constants/dab_parameters.h" +#include "dab/database/dab_database_entities.h" +#include "utility/observable.h" +#include "utility/span.h" +#include "viterbi_config.h" +#include "./basic_audio_channel.h" class PAD_Processor; struct plm_buffer_t; diff --git a/src/basic_radio/basic_dab_plus_channel.cpp b/src/basic_radio/basic_dab_plus_channel.cpp index f5d322e..c09a07d 100644 --- a/src/basic_radio/basic_dab_plus_channel.cpp +++ b/src/basic_radio/basic_dab_plus_channel.cpp @@ -1,13 +1,22 @@ #include "./basic_dab_plus_channel.h" -#include "./basic_slideshow.h" - -#include "dab/msc/msc_decoder.h" +#include +#include +#include +#include +#include #include "dab/audio/aac_audio_decoder.h" #include "dab/audio/aac_data_decoder.h" -#include "dab/mot/MOT_slideshow_processor.h" -#include - +#include "dab/audio/aac_frame_processor.h" +#include "dab/constants/dab_parameters.h" +#include "dab/database/dab_database_entities.h" +#include "dab/mot/MOT_entities.h" +#include "dab/msc/msc_decoder.h" +#include "utility/span.h" +#include "viterbi_config.h" +#include "./basic_audio_channel.h" +#include "./basic_audio_params.h" #include "./basic_radio_logging.h" +#include "./basic_slideshow.h" #define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) @@ -60,7 +69,7 @@ void Basic_DAB_Plus_Channel::SetupCallbacks(void) { audio_params.is_stereo = header.is_stereo; const bool replace_decoder = - (m_aac_audio_decoder == NULL) || + (m_aac_audio_decoder == nullptr) || (m_aac_audio_decoder->GetParams() != audio_params); if (replace_decoder) { diff --git a/src/basic_radio/basic_dab_plus_channel.h b/src/basic_radio/basic_dab_plus_channel.h index 9788044..8e5a022 100644 --- a/src/basic_radio/basic_dab_plus_channel.h +++ b/src/basic_radio/basic_dab_plus_channel.h @@ -1,7 +1,14 @@ #pragma once -#include "./basic_audio_channel.h" +#include +#include #include "dab/audio/aac_frame_processor.h" +#include "dab/constants/dab_parameters.h" +#include "dab/database/dab_database_entities.h" +#include "utility/observable.h" +#include "utility/span.h" +#include "viterbi_config.h" +#include "./basic_audio_channel.h" class AAC_Audio_Decoder; class AAC_Data_Decoder; diff --git a/src/basic_radio/basic_data_packet_channel.cpp b/src/basic_radio/basic_data_packet_channel.cpp index 7229887..bffbba6 100644 --- a/src/basic_radio/basic_data_packet_channel.cpp +++ b/src/basic_radio/basic_data_packet_channel.cpp @@ -1,15 +1,19 @@ #include "./basic_data_packet_channel.h" -#include #include +#include +#include +#include +#include +#include "dab/constants/dab_parameters.h" #include "dab/database/dab_database_entities.h" -#include "dab/msc/msc_decoder.h" +#include "dab/mot/MOT_processor.h" #include "dab/msc/msc_data_packet_processor.h" +#include "dab/msc/msc_decoder.h" #include "dab/msc/msc_reed_solomon_data_packet_processor.h" -#include "dab/mot/MOT_processor.h" -#include "./basic_slideshow.h" - -#include +#include "utility/span.h" +#include "viterbi_config.h" #include "./basic_radio_logging.h" +#include "./basic_slideshow.h" #define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) diff --git a/src/basic_radio/basic_data_packet_channel.h b/src/basic_radio/basic_data_packet_channel.h index 6069e2f..1447714 100644 --- a/src/basic_radio/basic_data_packet_channel.h +++ b/src/basic_radio/basic_data_packet_channel.h @@ -1,13 +1,13 @@ #pragma once +#include #include -#include "./basic_msc_runner.h" #include "dab/constants/dab_parameters.h" #include "dab/database/dab_database_entities.h" -#include "dab/database/dab_database_types.h" +#include "utility/observable.h" #include "utility/span.h" #include "viterbi_config.h" -#include "utility/observable.h" +#include "./basic_msc_runner.h" class MSC_Decoder; class MSC_Data_Packet_Processor; diff --git a/src/basic_radio/basic_fic_runner.cpp b/src/basic_radio/basic_fic_runner.cpp index c8c4a08..ab4d520 100644 --- a/src/basic_radio/basic_fic_runner.cpp +++ b/src/basic_radio/basic_fic_runner.cpp @@ -1,13 +1,14 @@ #include "./basic_fic_runner.h" - -#include "dab/dab_misc_info.h" -#include "dab/database/dab_database.h" +#include +#include +#include +#include "dab/constants/dab_parameters.h" #include "dab/database/dab_database_updater.h" #include "dab/fic/fic_decoder.h" #include "dab/fic/fig_processor.h" #include "dab/radio_fig_handler.h" -#include - +#include "utility/span.h" +#include "viterbi_config.h" #include "./basic_radio_logging.h" #define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) diff --git a/src/basic_radio/basic_radio.cpp b/src/basic_radio/basic_radio.cpp index 3b713b7..9aeb3ae 100644 --- a/src/basic_radio/basic_radio.cpp +++ b/src/basic_radio/basic_radio.cpp @@ -1,18 +1,24 @@ #include "./basic_radio.h" -#include "./basic_thread_pool.h" -#include "./basic_fic_runner.h" -#include "./basic_msc_runner.h" -#include "./basic_data_packet_channel.h" -#include "./basic_audio_channel.h" -#include "./basic_dab_plus_channel.h" -#include "./basic_dab_channel.h" +#include +#include +#include +#include +#include "dab/constants/dab_parameters.h" +#include "dab/dab_misc_info.h" #include "dab/database/dab_database.h" #include "dab/database/dab_database_entities.h" +#include "dab/database/dab_database_types.h" #include "dab/database/dab_database_updater.h" -#include "dab/dab_misc_info.h" -#include - +#include "utility/span.h" +#include "viterbi_config.h" +#include "./basic_audio_channel.h" +#include "./basic_dab_channel.h" +#include "./basic_dab_plus_channel.h" +#include "./basic_data_packet_channel.h" +#include "./basic_fic_runner.h" +#include "./basic_msc_runner.h" #include "./basic_radio_logging.h" +#include "./basic_thread_pool.h" #define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) diff --git a/src/basic_radio/basic_radio.h b/src/basic_radio/basic_radio.h index f1b8b11..40a7379 100644 --- a/src/basic_radio/basic_radio.h +++ b/src/basic_radio/basic_radio.h @@ -1,9 +1,9 @@ #pragma once -#include +#include #include #include - +#include #include "dab/constants/dab_parameters.h" #include "dab/database/dab_database_types.h" #include "utility/observable.h" diff --git a/src/basic_radio/basic_slideshow.cpp b/src/basic_radio/basic_slideshow.cpp index a705ff2..dee7d39 100644 --- a/src/basic_radio/basic_slideshow.cpp +++ b/src/basic_radio/basic_slideshow.cpp @@ -1,10 +1,15 @@ #include "./basic_slideshow.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "dab/constants/MOT_content_types.h" +#include "dab/mot/MOT_entities.h" #include "dab/mot/MOT_slideshow_processor.h" -#include "dab/mot/MOT_processor.h" -#include -#include - #include "./basic_radio_logging.h" #define LOG_MESSAGE(...) BASIC_RADIO_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_RADIO_LOG_ERROR(fmt::format(__VA_ARGS__)) diff --git a/src/basic_radio/basic_slideshow.h b/src/basic_radio/basic_slideshow.h index 2335e3e..b84a493 100644 --- a/src/basic_radio/basic_slideshow.h +++ b/src/basic_radio/basic_slideshow.h @@ -35,7 +35,7 @@ class Basic_Slideshow_Manager { private: std::list> m_slideshows; - Observable&> m_obs_on_new_slideshow; + Observable> m_obs_on_new_slideshow; size_t m_max_size; std::mutex m_mutex_slideshows; public: diff --git a/src/basic_scraper/basic_scraper.cpp b/src/basic_scraper/basic_scraper.cpp index 9be395d..c67b320 100644 --- a/src/basic_scraper/basic_scraper.cpp +++ b/src/basic_scraper/basic_scraper.cpp @@ -1,25 +1,34 @@ #include "./basic_scraper.h" -#include "basic_radio/basic_radio.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "basic_radio/basic_audio_channel.h" +#include "basic_radio/basic_audio_params.h" #include "basic_radio/basic_dab_channel.h" #include "basic_radio/basic_dab_plus_channel.h" #include "basic_radio/basic_data_packet_channel.h" #include "basic_radio/basic_radio.h" +#include "basic_radio/basic_radio.h" #include "basic_radio/basic_slideshow.h" +#include "dab/database/dab_database.h" #include "dab/database/dab_database_entities.h" #include "dab/database/dab_database_types.h" -#include "dab/mot/MOT_processor.h" -#include "dab/database/dab_database.h" -#include -#include -#include -#include +#include "utility/span.h" + +namespace fs = std::filesystem; #include "./basic_scraper_logging.h" #define LOG_MESSAGE(...) BASIC_SCRAPER_LOG_MESSAGE(fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) BASIC_SCRAPER_LOG_ERROR(fmt::format(__VA_ARGS__)) -#undef GetCurrentTime +#undef GetCurrentTime // NOLINT + static std::string GetCurrentTime(void) { auto t = std::time(nullptr); auto tm = *std::localtime(&t); @@ -80,7 +89,7 @@ void BasicScraper::attach_to_radio(std::shared_ptr scraper, BasicR auto slideshow_scraper = std::make_shared(abs_path / "slideshow"); channel.GetSlideshowManager().OnNewSlideshow().Attach( - [slideshow_scraper](std::shared_ptr& slideshow) { + [slideshow_scraper](std::shared_ptr slideshow) { slideshow_scraper->OnSlideshow(*slideshow); } ); @@ -105,7 +114,7 @@ void Basic_Audio_Channel_Scraper::attach_to_channel(std::shared_ptr& slideshow) { + [scraper](std::shared_ptr slideshow) { scraper->m_slideshow_scraper.OnSlideshow(*slideshow); } ); @@ -240,10 +249,10 @@ FILE* BasicAudioScraper::CreateWavFile(BasicAudioParams params) { const int32_t BitsPerSample = params.bytes_per_sample * 8; const int32_t SampleRate = static_cast(params.frequency); - memcpy(header.ChunkID, "RIFF", 4); - memcpy(header.Format, "WAVE", 4); - memcpy(header.Subchunk1ID, "fmt ", 4); - memcpy(header.Subchunk2ID, "data", 4); + std::memcpy(header.ChunkID, "RIFF", 4); + std::memcpy(header.Format, "WAVE", 4); + std::memcpy(header.Subchunk1ID, "fmt ", 4); + std::memcpy(header.Subchunk2ID, "data", 4); header.Subchunk1Size = 16; // size of PCM format fields header.AudioFormat = 1; // Linear quantisation diff --git a/src/basic_scraper/basic_scraper.h b/src/basic_scraper/basic_scraper.h index 96778f8..c312c7d 100644 --- a/src/basic_scraper/basic_scraper.h +++ b/src/basic_scraper/basic_scraper.h @@ -1,13 +1,14 @@ #pragma once -#include #include -#include +#include #include #include #include +#include +#include #include "basic_radio/basic_audio_params.h" -#include "dab/mot/MOT_entities.h" #include "dab/audio/aac_frame_processor.h" +#include "dab/mot/MOT_entities.h" #include "utility/span.h" namespace fs = std::filesystem; diff --git a/src/dab/algorithms/crc.h b/src/dab/algorithms/crc.h index 90cf355..599a59b 100644 --- a/src/dab/algorithms/crc.h +++ b/src/dab/algorithms/crc.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include // NOLINT #include "utility/span.h" // Source: http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html#ch44 diff --git a/src/dab/algorithms/dab_viterbi_decoder.cpp b/src/dab/algorithms/dab_viterbi_decoder.cpp index ef692c0..885a0da 100644 --- a/src/dab/algorithms/dab_viterbi_decoder.cpp +++ b/src/dab/algorithms/dab_viterbi_decoder.cpp @@ -1,14 +1,16 @@ #include "./dab_viterbi_decoder.h" +#include #include #include -#include #include - +#include +#include "detect_architecture.h" +#include "simd_flags.h" // NOLINT +#include "utility/span.h" #include "viterbi/viterbi_branch_table.h" #include "viterbi/viterbi_decoder_config.h" #include "viterbi/viterbi_decoder_core.h" -#include "detect_architecture.h" -#include "simd_flags.h" +#include "viterbi_config.h" // DOC: ETSI EN 300 401 // Clause 11.1 - Convolutional code diff --git a/src/dab/algorithms/reed_solomon_decoder.cpp b/src/dab/algorithms/reed_solomon_decoder.cpp index 49e0008..72705de 100644 --- a/src/dab/algorithms/reed_solomon_decoder.cpp +++ b/src/dab/algorithms/reed_solomon_decoder.cpp @@ -3,10 +3,9 @@ * May be used under the terms of the GNU Lesser General Public License (LGPL) */ #include "./reed_solomon_decoder.h" - -#include +#include #include - +#include // alloca() for windows #if _WIN32 #include @@ -65,6 +64,7 @@ static inline int modnn(struct RS_data *rs, int x) { #define PAD (rs->pad) #define A0 (NN) +// NOLINTBEGIN: clang-tidy really doesn't like this code // Found in init_rs_char.h and init_rs_char.c with code inlined from init_rs.h // This is a char only version of init_rs(..) struct RS_data *init_rs_char(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad) { @@ -475,6 +475,7 @@ int decode_rs_char(struct RS_data* rs, uint8_t *data, int *eras_pos, int no_eras retval = count; return retval; } +// NOLINTEND // C++ wrapper code Reed_Solomon_Decoder::Reed_Solomon_Decoder( diff --git a/src/dab/audio/aac_audio_decoder.cpp b/src/dab/audio/aac_audio_decoder.cpp index d28e23c..d86e727 100644 --- a/src/dab/audio/aac_audio_decoder.cpp +++ b/src/dab/audio/aac_audio_decoder.cpp @@ -1,9 +1,11 @@ #include "./aac_audio_decoder.h" +#include +#include #include +#include +#include #include -#include -#include - +#include "utility/span.h" #include "../dab_logging.h" #define TAG "aac-audio-decoder" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/audio/aac_data_decoder.cpp b/src/dab/audio/aac_data_decoder.cpp index 3d28be3..a0810b7 100644 --- a/src/dab/audio/aac_data_decoder.cpp +++ b/src/dab/audio/aac_data_decoder.cpp @@ -1,6 +1,8 @@ #include "./aac_data_decoder.h" -#include - +#include +#include +#include +#include "utility/span.h" #include "../dab_logging.h" #define TAG "aac-data-decoder" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/audio/aac_frame_processor.cpp b/src/dab/audio/aac_frame_processor.cpp index 79f3d53..979d36e 100644 --- a/src/dab/audio/aac_frame_processor.cpp +++ b/src/dab/audio/aac_frame_processor.cpp @@ -1,8 +1,11 @@ #include "./aac_frame_processor.h" -#include "../algorithms/reed_solomon_decoder.h" +#include +#include +#include +#include +#include "utility/span.h" #include "../algorithms/crc.h" -#include - +#include "../algorithms/reed_solomon_decoder.h" #include "../dab_logging.h" #define TAG "aac-frame-processor" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/audio/mp2_audio_decoder.cpp b/src/dab/audio/mp2_audio_decoder.cpp index 3c09f52..a1d8049 100644 --- a/src/dab/audio/mp2_audio_decoder.cpp +++ b/src/dab/audio/mp2_audio_decoder.cpp @@ -26,10 +26,10 @@ SOFTWARE. */ #include "./mp2_audio_decoder.h" - -#include -#include #include +#include +#include +#include #ifndef PLM_MALLOC #define PLM_MALLOC(sz) malloc(sz) @@ -140,10 +140,10 @@ int plm_buffer_read(plm_buffer_t *self, int count) { while (count) { int current_byte = self->bytes[plm_buffer_get_read_head_bytes(self)]; - int remaining = 8 - (self->bit_index & 7); // Remaining bits in byte + int remaining = 8 - (self->bit_index & 7); // NOLINT: Remaining bits in byte int read = remaining < count ? remaining : count; // Bits in self run int shift = remaining - read; - int mask = (0xff >> (8 - read)); + int mask = (0xff >> (8 - read)); // NOLINT value = (value << read) | ((current_byte & (mask << shift)) >> shift); @@ -598,9 +598,8 @@ int plm_audio_decode_header(plm_audio_t *self) { plm_buffer_skip(self->buffer, 16); } - // Compute frame size, check if we have enough data to decode the whole - // frame. - int bitrate = PLM_AUDIO_BIT_RATE[self->bitrate_index]; + // Compute frame size, check if we have enough data to decode the whole frame. + int bitrate = PLM_AUDIO_BIT_RATE[self->bitrate_index]; // NOLINT int samplerate = PLM_AUDIO_SAMPLE_RATE[self->samplerate_index]; int frame_size = (144000 * bitrate / samplerate) + padding; return frame_size - (hasCRC ? 6 : 4); diff --git a/src/dab/constants/language_table.h b/src/dab/constants/language_table.h index f1b71a4..3e9d266 100644 --- a/src/dab/constants/language_table.h +++ b/src/dab/constants/language_table.h @@ -1,8 +1,7 @@ #pragma once -#include -#include #include +#include #include "../database/dab_database_types.h" // Referring to database/dab_database_types.h diff --git a/src/dab/constants/programme_type_table.h b/src/dab/constants/programme_type_table.h index c8938f2..0cb9a2e 100644 --- a/src/dab/constants/programme_type_table.h +++ b/src/dab/constants/programme_type_table.h @@ -1,7 +1,8 @@ #pragma once -#include +#include #include +#include #include "../database/dab_database_types.h" struct DAB_Programme_Label { diff --git a/src/dab/dab_logging.cpp b/src/dab/dab_logging.cpp index 0dd785f..89be2c6 100644 --- a/src/dab/dab_logging.cpp +++ b/src/dab/dab_logging.cpp @@ -1,4 +1,5 @@ #include "./dab_logging.h" +#include #if DAB_LOGGING_USE_EASYLOGGING diff --git a/src/dab/database/dab_database.h b/src/dab/database/dab_database.h index c39582a..0f873fe 100644 --- a/src/dab/database/dab_database.h +++ b/src/dab/database/dab_database.h @@ -1,9 +1,7 @@ #pragma once -#include "./dab_database_entities.h" -#include "./dab_database_types.h" -#include "./utility/span.h" #include +#include "./dab_database_entities.h" struct DAB_Database { diff --git a/src/dab/database/dab_database_updater.cpp b/src/dab/database/dab_database_updater.cpp index 106bdd3..3a89be9 100644 --- a/src/dab/database/dab_database_updater.cpp +++ b/src/dab/database/dab_database_updater.cpp @@ -1,14 +1,12 @@ #include "./dab_database_updater.h" - -#include -#include -#include - -#include "../dab_logging.h" -#define TAG "db-updater" -static auto _logger = DAB_LOG_REGISTER(TAG); -#define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) -#define LOG_ERROR(...) DAB_LOG_ERROR(TAG, fmt::format(__VA_ARGS__)) +#include +#include +#include +#include +#include "utility/span.h" +#include "./dab_database.h" +#include "./dab_database_entities.h" +#include "./dab_database_types.h" template bool insert_if_unique(std::vector& vec, T value) { diff --git a/src/dab/database/dab_database_updater.h b/src/dab/database/dab_database_updater.h index 516826d..93b5927 100644 --- a/src/dab/database/dab_database_updater.h +++ b/src/dab/database/dab_database_updater.h @@ -1,13 +1,16 @@ #pragma once -#include #include -#include -#include +#include +#include #include -#include "./dab_database.h" -#include "dab/database/dab_database_entities.h" +#include +#include +#include #include "utility/span.h" +#include "./dab_database.h" +#include "./dab_database_entities.h" +#include "./dab_database_types.h" struct DatabaseUpdaterGlobalStatistics { size_t nb_total = 0; diff --git a/src/dab/fic/fic_decoder.cpp b/src/dab/fic/fic_decoder.cpp index 824c6fe..06b851d 100644 --- a/src/dab/fic/fic_decoder.cpp +++ b/src/dab/fic/fic_decoder.cpp @@ -1,12 +1,15 @@ -#include "fic_decoder.h" - -#include "../algorithms/dab_viterbi_decoder.h" +#include "./fic_decoder.h" +#include +#include +#include +#include +#include +#include "utility/span.h" +#include "viterbi_config.h" #include "../algorithms/additive_scrambler.h" #include "../algorithms/crc.h" +#include "../algorithms/dab_viterbi_decoder.h" #include "../constants/puncture_codes.h" -#include -#include - #include "../dab_logging.h" #define TAG "fic-decoder" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/fic/fig_processor.cpp b/src/dab/fic/fig_processor.cpp index fcb1f40..6701050 100644 --- a/src/dab/fic/fig_processor.cpp +++ b/src/dab/fic/fig_processor.cpp @@ -4,9 +4,12 @@ // All the logic in this file is completely based on the descriptions in these clauses #include "./fig_processor.h" +#include +#include +#include +#include +#include "utility/span.h" #include "./fig_handler_interface.h" -#include - #include "../dab_logging.h" #define TAG "fig-processor" static auto _logger = DAB_LOG_REGISTER(TAG); @@ -59,7 +62,7 @@ struct EnsembleIdentifier { // A FIB (fast information block) contains many FIGs (fast information groups) void FIG_Processor::ProcessFIB(tcb::span buf) { // Dont do anything if we don't have an associated handler - if (m_handler == NULL) { + if (m_handler == nullptr) { return; } @@ -267,10 +270,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_0( } // Subchannel for stream mode MSC -void FIG_Processor::ProcessFIG_Type_0_Ext_1( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_1(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); int curr_byte = 0; int curr_subchannel = 0; @@ -334,10 +334,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_1( } // Service and service components information in stream mode -void FIG_Processor::ProcessFIG_Type_0_Ext_2( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_2(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_service_id_bytes = header.pd ? 4 : 2; // In addition to the service id field, we have an additional byte of fields @@ -463,10 +460,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_2( } // Service components information in packet mode -void FIG_Processor::ProcessFIG_Type_0_Ext_3( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_3(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_header_bytes = 5; const int nb_CAOrg_field_bytes = 2; @@ -557,10 +551,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_4( } // Service component language -void FIG_Processor::ProcessFIG_Type_0_Ext_5( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_5(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); int curr_byte = 0; while (curr_byte < N) { @@ -609,10 +600,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_5( } // Service linking information -void FIG_Processor::ProcessFIG_Type_0_Ext_6( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_6(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_header_bytes = 2; @@ -920,10 +908,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_6( } // Configuration information -void FIG_Processor::ProcessFIG_Type_0_Ext_7( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_7(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_data_bytes = 2; if (N != nb_data_bytes) { @@ -945,10 +930,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_7( } // Service component global definition -void FIG_Processor::ProcessFIG_Type_0_Ext_8( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_8(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_service_id_bytes = header.pd ? 4 : 2; // In addition to the service id field, we have an additional byte of fields @@ -1035,10 +1017,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_8( } // Country, LTO and International Table -void FIG_Processor::ProcessFIG_Type_0_Ext_9( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_9(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_header_bytes = 3; if (nb_header_bytes > N) { @@ -1139,10 +1118,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_9( } // Date and time -void FIG_Processor::ProcessFIG_Type_0_Ext_10( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_10(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_min_bytes = 4; if (nb_min_bytes > N) { @@ -1195,10 +1171,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_10( } // User application information -void FIG_Processor::ProcessFIG_Type_0_Ext_13( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_13(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_service_id_bytes = header.pd ? 4 : 2; // In addition to the service id field, we have an additional byte of fields @@ -1263,7 +1236,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_13( curr_block, i, nb_user_apps, user_app_type, nb_app_data_bytes); - auto* app_data_buf = (nb_app_data_bytes > 0) ? &app_buf[nb_app_header_bytes] : NULL; + auto* app_data_buf = (nb_app_data_bytes > 0) ? &app_buf[nb_app_header_bytes] : nullptr; m_handler->OnServiceComponent_5_UserApplication( sid.country_id, sid.service_reference, sid.ecc, SCIdS, @@ -1279,10 +1252,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_13( } // Subchannel for packet mode MSC FEC type -void FIG_Processor::ProcessFIG_Type_0_Ext_14( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_14(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); for (int i = 0; i < N; i++) { @@ -1393,10 +1363,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_17( } // Frequency information -void FIG_Processor::ProcessFIG_Type_0_Ext_21( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_21(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_block_header_bytes = 2; @@ -1601,10 +1568,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_21( } // OE Services for service following? -void FIG_Processor::ProcessFIG_Type_0_Ext_24( - const FIG_Header_Type_0 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_0_Ext_24(const FIG_Header_Type_0 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_sid_bytes = header.pd ? 4 : 2; const int nb_header_bytes = nb_sid_bytes + 1; @@ -1662,10 +1626,7 @@ void FIG_Processor::ProcessFIG_Type_0_Ext_24( } // Ensemble label -void FIG_Processor::ProcessFIG_Type_1_Ext_0( - const FIG_Header_Type_1 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_1_Ext_0(const FIG_Header_Type_1 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_eid_bytes = 2; const int nb_char_bytes = 16; @@ -1701,10 +1662,7 @@ void FIG_Processor::ProcessFIG_Type_1_Ext_0( } // Short form service identifier label -void FIG_Processor::ProcessFIG_Type_1_Ext_1( - const FIG_Header_Type_1 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_1_Ext_1(const FIG_Header_Type_1 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_sid_bytes = 2; const int nb_char_bytes = 16; @@ -1738,10 +1696,7 @@ void FIG_Processor::ProcessFIG_Type_1_Ext_1( } // Service component label (non primary) -void FIG_Processor::ProcessFIG_Type_1_Ext_4( - const FIG_Header_Type_1 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_1_Ext_4(const FIG_Header_Type_1 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_header_bytes = 1; const int nb_char_bytes = 16; @@ -1796,10 +1751,7 @@ void FIG_Processor::ProcessFIG_Type_1_Ext_4( } // Long form service identifier label -void FIG_Processor::ProcessFIG_Type_1_Ext_5( - const FIG_Header_Type_1 header, - tcb::span buf) -{ +void FIG_Processor::ProcessFIG_Type_1_Ext_5(const FIG_Header_Type_1 header, tcb::span buf) { const int N = (int)buf.size(); const int nb_sid_bytes = 4; const int nb_char_bytes = 16; diff --git a/src/dab/mot/MOT_assembler.cpp b/src/dab/mot/MOT_assembler.cpp index e450455..c032545 100644 --- a/src/dab/mot/MOT_assembler.cpp +++ b/src/dab/mot/MOT_assembler.cpp @@ -1,7 +1,9 @@ #include "./MOT_assembler.h" -#include -#include - +#include +#include +#include +#include +#include "utility/span.h" #include "../dab_logging.h" #define TAG "mot-assembler" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/mot/MOT_processor.cpp b/src/dab/mot/MOT_processor.cpp index 45585c0..5ae8551 100644 --- a/src/dab/mot/MOT_processor.cpp +++ b/src/dab/mot/MOT_processor.cpp @@ -1,12 +1,16 @@ #include "./MOT_processor.h" -#include "../algorithms/modified_julian_date.h" +#include +#include #include +#include #include -#include -#include - +#include +#include +#include "utility/span.h" +#include "./MOT_assembler.h" +#include "./MOT_entities.h" +#include "../algorithms/modified_julian_date.h" #include "../dab_logging.h" -#include "mot/MOT_entities.h" #define TAG "mot-processor" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/mot/MOT_processor.h b/src/dab/mot/MOT_processor.h index 9527073..31c2d83 100644 --- a/src/dab/mot/MOT_processor.h +++ b/src/dab/mot/MOT_processor.h @@ -1,15 +1,14 @@ #pragma once +#include #include -#include -#include #include - -#include "./MOT_entities.h" -#include "./MOT_assembler.h" -#include "utility/observable.h" +#include #include "utility/lru_cache.h" +#include "utility/observable.h" #include "utility/span.h" +#include "./MOT_assembler.h" +#include "./MOT_entities.h" // DOC: ETSI EN 301 234 // Clause 5.2.2: X-PAD diff --git a/src/dab/mot/MOT_slideshow_processor.cpp b/src/dab/mot/MOT_slideshow_processor.cpp index 732719c..d300540 100644 --- a/src/dab/mot/MOT_slideshow_processor.cpp +++ b/src/dab/mot/MOT_slideshow_processor.cpp @@ -1,6 +1,8 @@ #include "./MOT_slideshow_processor.h" -#include - +#include +#include +#include +#include "utility/span.h" #include "../dab_logging.h" #define TAG "mot-slideshow" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/msc/cif_deinterleaver.cpp b/src/dab/msc/cif_deinterleaver.cpp index 474fe79..c0359fd 100644 --- a/src/dab/msc/cif_deinterleaver.cpp +++ b/src/dab/msc/cif_deinterleaver.cpp @@ -1,10 +1,11 @@ #include "./cif_deinterleaver.h" - -constexpr int TOTAL_CIF_DEINTERLEAVE = 16; +#include "utility/span.h" +#include "viterbi_config.h" // DOC: ETSI EN 300 401 // Clause 12 - Time interleaving // Deinterleaving indices copied from table 21 +constexpr int TOTAL_CIF_DEINTERLEAVE = 16; const int CIF_INDICES_OFFSETS[TOTAL_CIF_DEINTERLEAVE] = { 0,8,4,12, 2,10,6,14, 1,9,5,13, 3,11,7,15 }; diff --git a/src/dab/msc/msc_data_group_processor.cpp b/src/dab/msc/msc_data_group_processor.cpp index b83da0e..41cb3c1 100644 --- a/src/dab/msc/msc_data_group_processor.cpp +++ b/src/dab/msc/msc_data_group_processor.cpp @@ -1,7 +1,9 @@ #include "./msc_data_group_processor.h" +#include +#include +#include +#include "utility/span.h" #include "../algorithms/crc.h" -#include - #include "../dab_logging.h" #define TAG "msc-data-group-processor" #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/msc/msc_data_packet_processor.cpp b/src/dab/msc/msc_data_packet_processor.cpp index 7bf6786..04e19ca 100644 --- a/src/dab/msc/msc_data_packet_processor.cpp +++ b/src/dab/msc/msc_data_packet_processor.cpp @@ -1,13 +1,14 @@ #include "./msc_data_packet_processor.h" +#include +#include +#include +#include +#include +#include "utility/span.h" #include "./msc_data_group_processor.h" -#include "../mot/MOT_processor.h" #include "../algorithms/crc.h" -#include -#include - -#include #include "../dab_logging.h" -#include "database/dab_database_entities.h" +#include "../mot/MOT_processor.h" #define TAG "msc-data-packet-processor" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/msc/msc_decoder.cpp b/src/dab/msc/msc_decoder.cpp index 48cdaf1..9ee20b8 100644 --- a/src/dab/msc/msc_decoder.cpp +++ b/src/dab/msc/msc_decoder.cpp @@ -1,14 +1,18 @@ #include "./msc_decoder.h" - +#include +#include +#include +#include +#include +#include "utility/span.h" +#include "viterbi_config.h" #include "./cif_deinterleaver.h" -#include "../database/dab_database_entities.h" -#include "../algorithms/dab_viterbi_decoder.h" #include "../algorithms/additive_scrambler.h" +#include "../algorithms/dab_viterbi_decoder.h" #include "../constants/puncture_codes.h" #include "../constants/subchannel_protection_tables.h" -#include - #include "../dab_logging.h" +#include "../database/dab_database_entities.h" #define TAG "msc-decoder" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/msc/msc_reed_solomon_data_packet_processor.cpp b/src/dab/msc/msc_reed_solomon_data_packet_processor.cpp index f72a465..1b07894 100644 --- a/src/dab/msc/msc_reed_solomon_data_packet_processor.cpp +++ b/src/dab/msc/msc_reed_solomon_data_packet_processor.cpp @@ -1,10 +1,13 @@ #include "./msc_reed_solomon_data_packet_processor.h" -#include "../algorithms/reed_solomon_decoder.h" #include - -#include +#include +#include +#include +#include +#include +#include "utility/span.h" +#include "../algorithms/reed_solomon_decoder.h" #include "../dab_logging.h" -#include "database/dab_database_entities.h" #define TAG "msc-reed-solomon-data-packet-processor" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/msc/msc_reed_solomon_data_packet_processor.h b/src/dab/msc/msc_reed_solomon_data_packet_processor.h index 7014551..b79fa9a 100644 --- a/src/dab/msc/msc_reed_solomon_data_packet_processor.h +++ b/src/dab/msc/msc_reed_solomon_data_packet_processor.h @@ -1,11 +1,12 @@ #pragma once -#include #include -#include -#include +#include #include #include +#include +#include +#include #include "utility/span.h" class Reed_Solomon_Decoder; diff --git a/src/dab/pad/pad_MOT_processor.cpp b/src/dab/pad/pad_MOT_processor.cpp index 814a9b2..c4a84df 100644 --- a/src/dab/pad/pad_MOT_processor.cpp +++ b/src/dab/pad/pad_MOT_processor.cpp @@ -1,9 +1,12 @@ #include "./pad_MOT_processor.h" -#include "../msc/msc_data_group_processor.h" -#include "../mot/MOT_processor.h" -#include - +#include +#include +#include +#include +#include "utility/span.h" #include "../dab_logging.h" +#include "../mot/MOT_processor.h" +#include "../msc/msc_data_group_processor.h" #define TAG "pad-MOT" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/pad/pad_MOT_processor.h b/src/dab/pad/pad_MOT_processor.h index 8c80caa..d8c3118 100644 --- a/src/dab/pad/pad_MOT_processor.h +++ b/src/dab/pad/pad_MOT_processor.h @@ -1,8 +1,10 @@ #pragma once +#include +#include #include -#include "./pad_data_group.h" #include "utility/span.h" +#include "./pad_data_group.h" class MOT_Processor; diff --git a/src/dab/pad/pad_data_group.cpp b/src/dab/pad/pad_data_group.cpp index f22edc5..12a23e0 100644 --- a/src/dab/pad/pad_data_group.cpp +++ b/src/dab/pad/pad_data_group.cpp @@ -1,4 +1,7 @@ #include "./pad_data_group.h" +#include +#include +#include "utility/span.h" #include "../algorithms/crc.h" static auto Generate_CRC_Calc() { diff --git a/src/dab/pad/pad_data_group.h b/src/dab/pad/pad_data_group.h index 6d2b810..b548ee3 100644 --- a/src/dab/pad/pad_data_group.h +++ b/src/dab/pad/pad_data_group.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include "utility/span.h" diff --git a/src/dab/pad/pad_data_length_indicator.cpp b/src/dab/pad/pad_data_length_indicator.cpp index 2f0b353..9124946 100644 --- a/src/dab/pad/pad_data_length_indicator.cpp +++ b/src/dab/pad/pad_data_length_indicator.cpp @@ -1,6 +1,8 @@ #include "./pad_data_length_indicator.h" -#include - +#include +#include +#include +#include "utility/span.h" #include "../dab_logging.h" #define TAG "pad-data-length" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/pad/pad_data_length_indicator.h b/src/dab/pad/pad_data_length_indicator.h index 88054e9..bb4cda0 100644 --- a/src/dab/pad/pad_data_length_indicator.h +++ b/src/dab/pad/pad_data_length_indicator.h @@ -1,5 +1,8 @@ #pragma once +#include +#include +#include "utility/span.h" #include "./pad_data_group.h" // Create data length indicator from XPAD segments diff --git a/src/dab/pad/pad_dynamic_label.cpp b/src/dab/pad/pad_dynamic_label.cpp index ec1d180..2920e22 100644 --- a/src/dab/pad/pad_dynamic_label.cpp +++ b/src/dab/pad/pad_dynamic_label.cpp @@ -1,15 +1,19 @@ #include "./pad_dynamic_label.h" +#include +#include +#include +#include +#include +#include +#include "utility/span.h" #include "./pad_dynamic_label_assembler.h" -#include -#include - #include "../dab_logging.h" #define TAG "pad-dynamic-label" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) #define LOG_ERROR(...) DAB_LOG_ERROR(TAG, fmt::format(__VA_ARGS__)) -#undef min +#undef min // NOLINT constexpr size_t TOTAL_CRC16_BYTES = 2; constexpr size_t TOTAL_HEADER_BYTES = 2; diff --git a/src/dab/pad/pad_dynamic_label.h b/src/dab/pad/pad_dynamic_label.h index 61f4374..67947d7 100644 --- a/src/dab/pad/pad_dynamic_label.h +++ b/src/dab/pad/pad_dynamic_label.h @@ -1,11 +1,12 @@ #pragma once +#include #include #include #include -#include "./pad_data_group.h" #include "utility/observable.h" #include "utility/span.h" +#include "./pad_data_group.h" class PAD_Dynamic_Label_Assembler; diff --git a/src/dab/pad/pad_dynamic_label_assembler.cpp b/src/dab/pad/pad_dynamic_label_assembler.cpp index e130679..d7f2685 100644 --- a/src/dab/pad/pad_dynamic_label_assembler.cpp +++ b/src/dab/pad/pad_dynamic_label_assembler.cpp @@ -1,6 +1,8 @@ #include "./pad_dynamic_label_assembler.h" -#include - +#include +#include +#include +#include "utility/span.h" #include "../dab_logging.h" #define TAG "pad-dynamic-label" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/pad/pad_dynamic_label_assembler.h b/src/dab/pad/pad_dynamic_label_assembler.h index d10a42f..b468341 100644 --- a/src/dab/pad/pad_dynamic_label_assembler.h +++ b/src/dab/pad/pad_dynamic_label_assembler.h @@ -1,4 +1,5 @@ #pragma once +#include #include #include #include "utility/span.h" diff --git a/src/dab/pad/pad_processor.cpp b/src/dab/pad/pad_processor.cpp index 2ac591b..cc95e9f 100644 --- a/src/dab/pad/pad_processor.cpp +++ b/src/dab/pad/pad_processor.cpp @@ -1,12 +1,17 @@ #include "./pad_processor.h" -#include "./pad_dynamic_label.h" -#include "./pad_data_length_indicator.h" -#include "./pad_MOT_processor.h" -#include "../mot/MOT_processor.h" #include -#include - +#include +#include +#include +#include +#include "utility/observable.h" +#include "utility/span.h" +#include "./pad_MOT_processor.h" +#include "./pad_data_length_indicator.h" +#include "./pad_dynamic_label.h" #include "../dab_logging.h" +#include "../mot/MOT_entities.h" +#include "../mot/MOT_processor.h" #define TAG "pad-processor" static auto _logger = DAB_LOG_REGISTER(TAG); #define LOG_MESSAGE(...) DAB_LOG_MESSAGE(TAG, fmt::format(__VA_ARGS__)) diff --git a/src/dab/radio_fig_handler.cpp b/src/dab/radio_fig_handler.cpp index 6b43283..fb5e3d8 100644 --- a/src/dab/radio_fig_handler.cpp +++ b/src/dab/radio_fig_handler.cpp @@ -1,11 +1,12 @@ #include "./radio_fig_handler.h" -#include "./database/dab_database_updater.h" -#include "./dab_misc_info.h" -#include "./constants/subchannel_protection_tables.h" +#include +#include +#include "utility/span.h" #include "./algorithms/modified_julian_date.h" -#include - +#include "./constants/subchannel_protection_tables.h" #include "./dab_logging.h" +#include "./dab_misc_info.h" +#include "./database/dab_database_updater.h" #include "database/dab_database_entities.h" #define TAG "radio-fig-handler" static auto _logger = DAB_LOG_REGISTER(TAG); diff --git a/src/dab/radio_fig_handler.h b/src/dab/radio_fig_handler.h index 2421826..5d46289 100644 --- a/src/dab/radio_fig_handler.h +++ b/src/dab/radio_fig_handler.h @@ -1,7 +1,8 @@ #pragma once -#include "./fic/fig_handler_interface.h" +#include #include "utility/span.h" +#include "./fic/fig_handler_interface.h" class DAB_Database_Updater; struct DAB_Misc_Info; @@ -10,8 +11,8 @@ struct DAB_Misc_Info; class Radio_FIG_Handler: public FIG_Handler_Interface { private: - DAB_Database_Updater* m_updater = NULL; - DAB_Misc_Info* m_misc_info = NULL; + DAB_Database_Updater* m_updater = nullptr; + DAB_Misc_Info* m_misc_info = nullptr; public: ~Radio_FIG_Handler() override = default; void SetUpdater(DAB_Database_Updater* updater) { m_updater = updater; } diff --git a/src/ofdm/circular_buffer.h b/src/ofdm/circular_buffer.h index e7e6989..9f11259 100644 --- a/src/ofdm/circular_buffer.h +++ b/src/ofdm/circular_buffer.h @@ -1,5 +1,6 @@ #pragma once +#include #include "utility/span.h" template diff --git a/src/ofdm/dab_mapper_ref.cpp b/src/ofdm/dab_mapper_ref.cpp index f33ebb7..f735095 100644 --- a/src/ofdm/dab_mapper_ref.cpp +++ b/src/ofdm/dab_mapper_ref.cpp @@ -1,5 +1,7 @@ #include "./dab_mapper_ref.h" +#include #include +#include "utility/span.h" // DOC: ETSI EN 300 401 // Referring to clause 14.6 - Frequency interleaving diff --git a/src/ofdm/dab_mapper_ref.h b/src/ofdm/dab_mapper_ref.h index 4553a68..59b28c8 100644 --- a/src/ofdm/dab_mapper_ref.h +++ b/src/ofdm/dab_mapper_ref.h @@ -1,5 +1,6 @@ #pragma once +#include #include "utility/span.h" // Generate a carrier map with a reference fft size diff --git a/src/ofdm/dab_ofdm_params_ref.cpp b/src/ofdm/dab_ofdm_params_ref.cpp index 98aedc9..5b3bddd 100644 --- a/src/ofdm/dab_ofdm_params_ref.cpp +++ b/src/ofdm/dab_ofdm_params_ref.cpp @@ -1,8 +1,7 @@ #include "./dab_ofdm_params_ref.h" - -#include #include -#include +#include +#include "./ofdm_params.h" // DOC: doc/DAB_parameters.pdf // Clause A1.1 - System parameters diff --git a/src/ofdm/dab_prs_ref.cpp b/src/ofdm/dab_prs_ref.cpp index 08dce7f..e6cf6bf 100644 --- a/src/ofdm/dab_prs_ref.cpp +++ b/src/ofdm/dab_prs_ref.cpp @@ -1,9 +1,10 @@ #define _USE_MATH_DEFINES #include - #include "./dab_prs_ref.h" +#include #include -#include +#include +#include "utility/span.h" struct PRS_Table_Entry { int k_min; @@ -165,7 +166,7 @@ void get_DAB_PRS_reference(const int transmission_mode, tcb::span( std::cos(phi), std::sin(phi) @@ -180,7 +181,7 @@ void get_DAB_PRS_reference(const int transmission_mode, tcb::span( std::cos(phi), std::sin(phi) diff --git a/src/ofdm/dsp/apply_pll.cpp b/src/ofdm/dsp/apply_pll.cpp index b203817..ccfe909 100644 --- a/src/ofdm/dsp/apply_pll.cpp +++ b/src/ofdm/dsp/apply_pll.cpp @@ -1,9 +1,11 @@ #include -#include +#include // NOLINT +#include #include - +#include #include "detect_architecture.h" -#include "simd_flags.h" +#include "simd_flags.h" // NOLINT +#include "utility/span.h" #include "./apply_pll.h" #include "./chebyshev_sine.h" @@ -29,10 +31,11 @@ static void apply_pll_scalar( // x86 #if defined(__ARCH_X86__) -#include -#include "./x86/c32_mul.h" #if defined(__SSE3__) +#include +#include +#include "./x86/c32_mul.h" static void apply_pll_sse3( tcb::span> x, tcb::span> y, @@ -72,6 +75,9 @@ static void apply_pll_sse3( #endif #if defined(__AVX__) +#include +#include +#include "./x86/c32_mul.h" static void apply_pll_avx( tcb::span> x, tcb::span> y, diff --git a/src/ofdm/dsp/chebyshev_sine.h b/src/ofdm/dsp/chebyshev_sine.h index 6f9860f..7382d70 100644 --- a/src/ofdm/dsp/chebyshev_sine.h +++ b/src/ofdm/dsp/chebyshev_sine.h @@ -1,7 +1,7 @@ #pragma once #include "detect_architecture.h" -#include "simd_flags.h" +#include "simd_flags.h" // NOLINT // SOURCE: https://gist.github.com/williamyang98/7aca0ca0f1978c7374a66002892e0d8a // Chebyshev polynomial that approximates f(x) = sin(2*pi*x) accurately within [-0.5,+0.5] @@ -45,6 +45,7 @@ static float chebyshev_sine(float x) { #include #if defined(__SSE__) +#include static inline __m128 _mm_chebyshev_sine(__m128 x) { const __m128 A0 = _mm_set1_ps(CHEBYSHEV_POLYNOMIAL_COEFFICIENTS[0]); const __m128 A1 = _mm_set1_ps(CHEBYSHEV_POLYNOMIAL_COEFFICIENTS[1]); diff --git a/src/ofdm/dsp/complex_conj_mul_sum.cpp b/src/ofdm/dsp/complex_conj_mul_sum.cpp index c7eb3f1..634f963 100644 --- a/src/ofdm/dsp/complex_conj_mul_sum.cpp +++ b/src/ofdm/dsp/complex_conj_mul_sum.cpp @@ -1,10 +1,9 @@ -#include -#include #include -#include "utility/span.h" - +#include +#include #include "detect_architecture.h" -#include "simd_flags.h" +#include "simd_flags.h" // NOLINT +#include "utility/span.h" #include "./complex_conj_mul_sum.h" std::complex complex_conj_mul_sum_scalar( @@ -26,6 +25,7 @@ std::complex complex_conj_mul_sum_scalar( #include "./x86/c32_conj_mul.h" #if defined(__SSE3__) +#include std::complex complex_conj_mul_sum_sse3( tcb::span> x0, tcb::span> x1) @@ -61,6 +61,7 @@ std::complex complex_conj_mul_sum_sse3( #endif #if defined(__AVX__) +#include std::complex complex_conj_mul_sum_avx( tcb::span> x0, tcb::span> x1) diff --git a/src/ofdm/dsp/x86/c32_conj_mul.h b/src/ofdm/dsp/x86/c32_conj_mul.h index a5fc659..184f0ea 100644 --- a/src/ofdm/dsp/x86/c32_conj_mul.h +++ b/src/ofdm/dsp/x86/c32_conj_mul.h @@ -2,13 +2,13 @@ #include #include -#include "simd_flags.h" +#include "simd_flags.h" // NOLINT // Conjugate multiply packed complex float // Y = X0*~X1 #if defined(__AVX__) -__m256 c32_conj_mul_avx(__m256 x0, __m256 x1) { +static inline __m256 c32_conj_mul_avx(__m256 x0, __m256 x1) { // Vectorise complex conjugate multiplication // [3 2 1 0] -> [2 3 0 1] constexpr uint8_t SWAP_COMPONENT_MASK = 0b10110001; @@ -44,7 +44,8 @@ __m256 c32_conj_mul_avx(__m256 x0, __m256 x1) { #endif #if defined(__SSE3__) -__m128 c32_conj_mul_sse3(__m128 x0, __m128 x1) { +#include +static inline __m128 c32_conj_mul_sse3(__m128 x0, __m128 x1) { // Vectorise complex conjugate multiplication // [3 2 1 0] -> [2 3 0 1] constexpr uint8_t SWAP_COMPONENT_MASK = 0b10110001; diff --git a/src/ofdm/dsp/x86/c32_mul.h b/src/ofdm/dsp/x86/c32_mul.h index a619889..1ad0b69 100644 --- a/src/ofdm/dsp/x86/c32_mul.h +++ b/src/ofdm/dsp/x86/c32_mul.h @@ -1,13 +1,13 @@ #pragma once -#include #include -#include "simd_flags.h" +#include "simd_flags.h" // NOLINT // Multiply packed complex float #if defined(__AVX__) -__m256 c32_mul_avx(__m256 x0, __m256 x1) { +#include +static inline __m256 c32_mul_avx(__m256 x0, __m256 x1) { // Vectorise complex multiplication // [3 2 1 0] -> [2 3 0 1] constexpr uint8_t SWAP_COMPONENT_MASK = 0b10110001; @@ -40,7 +40,8 @@ __m256 c32_mul_avx(__m256 x0, __m256 x1) { #endif #if defined(__SSE3__) -__m128 c32_mul_sse3(__m128 x0, __m128 x1) { +#include +static inline __m128 c32_mul_sse3(__m128 x0, __m128 x1) { // Vectorise complex multiplication // [3 2 1 0] -> [2 3 0 1] constexpr uint8_t SWAP_COMPONENT_MASK = 0b10110001; diff --git a/src/ofdm/ofdm_demodulator.cpp b/src/ofdm/ofdm_demodulator.cpp index 8f38251..2c1c43a 100644 --- a/src/ofdm/ofdm_demodulator.cpp +++ b/src/ofdm/ofdm_demodulator.cpp @@ -1,17 +1,23 @@ #define _USE_MATH_DEFINES #include -#include -#include - #include "./ofdm_demodulator.h" -#include "./ofdm_demodulator_threads.h" -#include "./dsp/apply_pll.h" -#include "./dsp/complex_conj_mul_sum.h" - +#include +#include +#include +#include +#include +#include +#include #include #include "detect_architecture.h" -#include "simd_flags.h" +#include "simd_flags.h" // NOLINT #include "utility/joint_allocate.h" +#include "utility/span.h" +#include "viterbi_config.h" +#include "./dsp/apply_pll.h" +#include "./dsp/complex_conj_mul_sum.h" +#include "./ofdm_demodulator_threads.h" +#include "./ofdm_params.h" #define PROFILE_ENABLE 1 #include "./profiler.h" @@ -36,7 +42,7 @@ constexpr size_t ALIGN_AMOUNT = 16; #endif -constexpr float TWO_PI = float(M_PI) * 2.0f; +constexpr float TWO_PI = float(M_PI) * 2.0f; // NOLINT // DOC: docs/DAB_implementation_in_SDR_detailed.pdf @@ -104,8 +110,8 @@ OFDM_Demod::OFDM_Demod( m_pipeline_out_bits, BufferParameters{ (m_params.nb_frame_symbols-1)*m_params.nb_data_carriers*2 } ); - m_fft_plan = fftwf_plan_dft_1d((int)m_params.nb_fft, NULL, NULL, FFTW_FORWARD, FFTW_ESTIMATE); - m_ifft_plan = fftwf_plan_dft_1d((int)m_params.nb_fft, NULL, NULL, FFTW_BACKWARD, FFTW_ESTIMATE); + m_fft_plan = fftwf_plan_dft_1d((int)m_params.nb_fft, nullptr, nullptr, FFTW_FORWARD, FFTW_ESTIMATE); + m_ifft_plan = fftwf_plan_dft_1d((int)m_params.nb_fft, nullptr, nullptr, FFTW_BACKWARD, FFTW_ESTIMATE); // Initial state of demodulator m_state = State::FINDING_NULL_POWER_DIP; @@ -190,7 +196,7 @@ void OFDM_Demod::CreateThreads(int nb_desired_threads) { // Some pipelines depend on data being processed in other pipelines const size_t dependent_pipeline_index = i+1; - OFDM_Demod_Pipeline* dependent_pipeline = NULL; + OFDM_Demod_Pipeline* dependent_pipeline = nullptr; if (dependent_pipeline_index < m_pipelines.size()) { dependent_pipeline = m_pipelines[dependent_pipeline_index].get(); } @@ -734,7 +740,7 @@ bool OFDM_Demod::PipelineThread(OFDM_Demod_Pipeline& thread_data, OFDM_Demod_Pip // Get DQPSK result for last symbol in this thread // which is dependent on other threads finishing - if (dependent_thread_data != NULL) { + if (dependent_thread_data != nullptr) { PROFILE_BEGIN(calculate_independent_dqpsk); calculate_dqpsk(symbol_start, symbol_end_dqpsk-1); PROFILE_END(calculate_independent_dqpsk); diff --git a/src/ofdm/ofdm_demodulator.h b/src/ofdm/ofdm_demodulator.h index 9635ada..990112e 100644 --- a/src/ofdm/ofdm_demodulator.h +++ b/src/ofdm/ofdm_demodulator.h @@ -1,20 +1,20 @@ #pragma once +#include #include #include -#include +#include #include +#include #include -#include - -#include "./ofdm_params.h" -#include "./ofdm_frame_buffer.h" -#include "./reconstruction_buffer.h" -#include "./circular_buffer.h" +#include "utility/aligned_allocator.hpp" #include "utility/observable.h" #include "utility/span.h" -#include "utility/aligned_allocator.hpp" #include "viterbi_config.h" +#include "./circular_buffer.h" +#include "./ofdm_frame_buffer.h" +#include "./ofdm_params.h" +#include "./reconstruction_buffer.h" struct fftwf_plan_s; diff --git a/src/ofdm/ofdm_demodulator_threads.cpp b/src/ofdm/ofdm_demodulator_threads.cpp index ada1f26..6bce2d2 100644 --- a/src/ofdm/ofdm_demodulator_threads.cpp +++ b/src/ofdm/ofdm_demodulator_threads.cpp @@ -1,5 +1,6 @@ #include "./ofdm_demodulator_threads.h" -#include +#include +#include #define PROFILE_ENABLE 1 #include "./profiler.h" diff --git a/src/ofdm/ofdm_demodulator_threads.h b/src/ofdm/ofdm_demodulator_threads.h index a678667..fb8f167 100644 --- a/src/ofdm/ofdm_demodulator_threads.h +++ b/src/ofdm/ofdm_demodulator_threads.h @@ -1,7 +1,8 @@ #pragma once -#include +#include #include +#include // Helper classes to manage synchronisation between the OFDM demodulator pipeline threads // We have an coordinator thread to synchronise our pipeline threads diff --git a/src/ofdm/ofdm_frame_buffer.h b/src/ofdm/ofdm_frame_buffer.h index 9220802..15d1a43 100644 --- a/src/ofdm/ofdm_frame_buffer.h +++ b/src/ofdm/ofdm_frame_buffer.h @@ -1,9 +1,11 @@ #pragma once +#include +#include +#include +#include #include "utility/span.h" #include "./ofdm_params.h" -#include -#include // Purpose of this class if to provide the necessary alignment to each symbol // so that FFTW3 can use SIMD to accelerate the FFT/IFFT @@ -107,7 +109,7 @@ class OFDM_Frame_Buffer const size_t nb_read = (src.size() > nb_required) ? nb_required : src.size(); auto wr_buf = sym_buf.subspan(m_curr_symbol_samples, nb_read); - std::copy_n(src.begin(), nb_read, wr_buf.begin()); + std::memcpy(wr_buf.begin(), src.begin(), nb_read*sizeof(T)); m_curr_symbol_samples += nb_read; // branchless math to update number of samples in OFDM frame diff --git a/src/ofdm/ofdm_helpers.h b/src/ofdm/ofdm_helpers.h index 1c27230..d4f8bcc 100644 --- a/src/ofdm/ofdm_helpers.h +++ b/src/ofdm/ofdm_helpers.h @@ -1,10 +1,13 @@ #pragma once +#include #include -#include "./ofdm_demodulator.h" +#include +#include "./dab_mapper_ref.h" #include "./dab_ofdm_params_ref.h" #include "./dab_prs_ref.h" -#include "./dab_mapper_ref.h" +#include "./ofdm_demodulator.h" +#include "./ofdm_params.h" static std::unique_ptr Create_OFDM_Demodulator(const int transmission_mode, const int total_threads=0) { const OFDM_Params ofdm_params = get_DAB_OFDM_params(transmission_mode); diff --git a/src/ofdm/ofdm_modulator.cpp b/src/ofdm/ofdm_modulator.cpp index 60d0b9b..5c3601e 100644 --- a/src/ofdm/ofdm_modulator.cpp +++ b/src/ofdm/ofdm_modulator.cpp @@ -1,6 +1,12 @@ #include "./ofdm_modulator.h" -#include +#include +#include #include +#include +#include +#include +#include "utility/span.h" +#include "./ofdm_params.h" OFDM_Modulator::OFDM_Modulator( const OFDM_Params& params, @@ -9,7 +15,7 @@ OFDM_Modulator::OFDM_Modulator( m_frame_out_size(params.nb_null_period + params.nb_symbol_period*params.nb_frame_symbols), m_data_in_size((params.nb_frame_symbols-1)*params.nb_data_carriers*2/8) { - m_ifft_plan = fftwf_plan_dft_1d((int)m_params.nb_fft, NULL, NULL, FFTW_BACKWARD, FFTW_ESTIMATE); + m_ifft_plan = fftwf_plan_dft_1d((int)m_params.nb_fft, nullptr, nullptr, FFTW_BACKWARD, FFTW_ESTIMATE); // interleave the bits for a OFDM symbol containing N data carriers m_prs_fft_ref.resize(m_params.nb_fft); diff --git a/src/ofdm/ofdm_modulator.h b/src/ofdm/ofdm_modulator.h index 3218b06..c1acd65 100644 --- a/src/ofdm/ofdm_modulator.h +++ b/src/ofdm/ofdm_modulator.h @@ -1,8 +1,9 @@ +#include #include #include #include -#include "./ofdm_params.h" #include "utility/span.h" +#include "./ofdm_params.h" typedef struct fftwf_plan_s* fftwf_plan; \ diff --git a/src/ofdm/ofdm_params.h b/src/ofdm/ofdm_params.h index f3cf5f8..d9fe7f6 100644 --- a/src/ofdm/ofdm_params.h +++ b/src/ofdm/ofdm_params.h @@ -1,10 +1,8 @@ #pragma once -#include #include -struct OFDM_Params -{ +struct OFDM_Params { size_t nb_frame_symbols; size_t nb_symbol_period; size_t nb_null_period; diff --git a/src/ofdm/profiler.h b/src/ofdm/profiler.h index 7617e67..e55485f 100644 --- a/src/ofdm/profiler.h +++ b/src/ofdm/profiler.h @@ -1,12 +1,14 @@ #pragma once +#include #include -#include -#include #include -#include #include #include +#include +#include +#include +#include // Crossplatform pretty function #ifdef _MSC_VER @@ -142,7 +144,7 @@ class InstrumentorThread for (const auto& e: stack_trace) { hash = (hash >> 32) ^ (hash << 32) ^ e.stack_index; // if (e.stack_index >= 2) continue; - if (e.name != NULL) { + if (e.name != nullptr) { for (const char* c = e.name; (*c) != 0; c++) { hash = (hash >> 8) ^ (hash << 8) ^ (uint64_t)(*c); } diff --git a/src/ofdm/reconstruction_buffer.h b/src/ofdm/reconstruction_buffer.h index f9a33f2..cfd63dc 100644 --- a/src/ofdm/reconstruction_buffer.h +++ b/src/ofdm/reconstruction_buffer.h @@ -1,5 +1,6 @@ #pragma once +#include #include "utility/span.h" // reconstruct a block of size M from blocks of size N diff --git a/src/utility/joint_allocate.h b/src/utility/joint_allocate.h index 5141441..3d307f7 100644 --- a/src/utility/joint_allocate.h +++ b/src/utility/joint_allocate.h @@ -1,11 +1,11 @@ #pragma once -#include -#include #include +#include +#include #include -#include "./span.h" #include "./aligned_allocator.hpp" +#include "./span.h" // Define the specification for each buffer inside the joint block struct BufferParameters { diff --git a/src/utility/lru_cache.h b/src/utility/lru_cache.h index 0816fb4..3201f04 100644 --- a/src/utility/lru_cache.h +++ b/src/utility/lru_cache.h @@ -1,7 +1,9 @@ #pragma once +#include #include #include +#include template class LRU_Cache diff --git a/src/utility/observable.h b/src/utility/observable.h index 3d8496e..1810780 100644 --- a/src/utility/observable.h +++ b/src/utility/observable.h @@ -1,8 +1,7 @@ #pragma once -#include #include - +#include template class Observable @@ -14,9 +13,10 @@ class Observable void Attach(const Observer& observer) { m_observers.push_back(observer); } + // Copies arguments to list of callbacks void Notify(T ... args) { for (const auto& o: m_observers) { - o(std::forward(args)...); + o(args...); } } }; \ No newline at end of file