mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-03-27 22:07:02 +00:00
Prefer initialization to assignment in constructors
This commit is contained in:
parent
158abd06db
commit
7fa437232a
src/algorithms/signal_source/libs
@ -34,12 +34,16 @@
|
||||
#include <utility> // for move
|
||||
|
||||
|
||||
Fpga_buffer_monitor::Fpga_buffer_monitor(const std::string &device_name, uint32_t num_freq_bands, bool dump, std::string dump_filename)
|
||||
Fpga_buffer_monitor::Fpga_buffer_monitor(const std::string &device_name,
|
||||
uint32_t num_freq_bands,
|
||||
bool dump,
|
||||
std::string dump_filename)
|
||||
: d_dump_filename(std::move(dump_filename)),
|
||||
d_num_freq_bands(num_freq_bands),
|
||||
d_max_buff_occ_freq_band_0(0),
|
||||
d_max_buff_occ_freq_band_1(0),
|
||||
d_dump(dump)
|
||||
{
|
||||
d_num_freq_bands = num_freq_bands;
|
||||
d_dump = dump;
|
||||
d_dump_filename = std::move(dump_filename);
|
||||
|
||||
// open device descriptor
|
||||
if ((d_device_descriptor = open(device_name.c_str(), O_RDWR | O_SYNC)) == -1)
|
||||
{
|
||||
@ -69,10 +73,6 @@ Fpga_buffer_monitor::Fpga_buffer_monitor(const std::string &device_name, uint32_
|
||||
|
||||
DLOG(INFO) << "FPGA buffer monitor class created";
|
||||
|
||||
// initialize maximum buffer occupancy in case buffer monitoring is enabled
|
||||
d_max_buff_occ_freq_band_0 = 0;
|
||||
d_max_buff_occ_freq_band_1 = 0;
|
||||
|
||||
if (d_dump)
|
||||
{
|
||||
std::string dump_path;
|
||||
|
@ -81,6 +81,9 @@ private:
|
||||
int32_t buffer_monitor_test_register();
|
||||
void close_device();
|
||||
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
|
||||
volatile unsigned* d_map_base; // driver memory map corresponding to the FPGA buffer monitor
|
||||
int d_device_descriptor; // driver descriptor corresponding to the FPGA buffer monitor
|
||||
|
||||
@ -90,8 +93,6 @@ private:
|
||||
uint32_t d_max_buff_occ_freq_band_1;
|
||||
|
||||
bool d_dump;
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user