1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 20:20:35 +00:00

moved logging output from template fct in header to source file to not have to include logging in header. Added maybe_unused to constructor argument which is unused to fix warning

This commit is contained in:
Lenhart 2021-04-19 16:05:53 +02:00
parent dbc8ea18bf
commit 595733bf67
No known key found for this signature in database
GPG Key ID: 7F3ECFDFD90E6B83
3 changed files with 12 additions and 4 deletions

View File

@ -28,7 +28,7 @@ using namespace std::string_literals;
FifoSignalSource::FifoSignalSource(ConfigurationInterface const* configuration, FifoSignalSource::FifoSignalSource(ConfigurationInterface const* configuration,
std::string const& role, unsigned int in_streams, unsigned int out_streams, std::string const& role, unsigned int in_streams, unsigned int out_streams,
Concurrent_Queue<pmt::pmt_t>* queue) [[maybe_unused]] Concurrent_Queue<pmt::pmt_t>* queue)
: SignalSourceBase(configuration, role, "Fifo_Signal_Source"s), : SignalSourceBase(configuration, role, "Fifo_Signal_Source"s),
item_size_(sizeof(gr_complex)), // currenty output item size is always gr_complex item_size_(sizeof(gr_complex)), // currenty output item size is always gr_complex
fifo_reader_(FifoReader::make(configuration->property(role + ".filename"s, "../data/example_capture.dat"s), fifo_reader_(FifoReader::make(configuration->property(role + ".filename"s, "../data/example_capture.dat"s),

View File

@ -101,9 +101,14 @@ size_t FifoReader::read_gr_complex(int noutput_items, gr_vector_void_star &outpu
} }
else else
{ {
LOG(ERROR) << "unhandled FIFO event"; fifo_error_output();
break; break;
} }
} }
return items_retrieved; return items_retrieved;
} }
void FifoReader::fifo_error_output() const
{
LOG(ERROR) << "unhandled FIFO event";
}

View File

@ -26,7 +26,6 @@
* \{ */ * \{ */
/** \addtogroup Signal_Source_gnuradio_blocks /** \addtogroup Signal_Source_gnuradio_blocks
* \{ */ * \{ */
class FifoReader : virtual public gr::sync_block class FifoReader : virtual public gr::sync_block
{ {
public: public:
@ -80,13 +79,17 @@ private:
} }
else else
{ {
LOG(ERROR) << "unhandled FIFO event"; fifo_error_output();
break; break;
} }
} }
return items_retrieved; return items_retrieved;
} }
//! this function moves logging output from this header into the source file
//! thereby eliminating the need to include glog/logging.h in this header
void fifo_error_output() const;
const std::string file_name_; const std::string file_name_;
const std::string sample_type_; const std::string sample_type_;
std::ifstream fifo_; std::ifstream fifo_;