Simplify block factory

Avoid duplication of code
This commit is contained in:
Carles Fernandez 2020-07-12 23:08:58 +02:00
parent da9795c7a1
commit 7fc0cec60c
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 192 additions and 838 deletions

File diff suppressed because it is too large Load Diff

View File

@ -50,12 +50,12 @@ public:
~GNSSBlockFactory() = default;
std::unique_ptr<GNSSBlockInterface> GetSignalSource(const ConfigurationInterface* configuration,
Concurrent_Queue<pmt::pmt_t>* queue, int ID = -1); // NOLINT(performance-unnecessary-value-param)
Concurrent_Queue<pmt::pmt_t>* queue, int ID = -1);
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const ConfigurationInterface* configuration, int ID = -1);
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const ConfigurationInterface* configuration,
Concurrent_Queue<pmt::pmt_t>* queue); // NOLINT(performance-unnecessary-value-param)
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetObservables(const ConfigurationInterface* configuration);
@ -67,61 +67,31 @@ public:
std::unique_ptr<GNSSBlockInterface> GetBlock(const ConfigurationInterface* configuration,
const std::string& role, const std::string& implementation,
unsigned int in_streams, unsigned int out_streams,
Concurrent_Queue<pmt::pmt_t>* queue = nullptr); // NOLINT(performance-unnecessary-value-param)
Concurrent_Queue<pmt::pmt_t>* queue = nullptr);
private:
std::unique_ptr<GNSSBlockInterface> GetChannel_1C(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_2S(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_1B(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_5X(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_L5(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_1G(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_2G(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_B1(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetChannel_B3(const ConfigurationInterface* configuration,
const std::string& acq, const std::string& trk, const std::string& tlm, int channel,
std::unique_ptr<GNSSBlockInterface> GetChannel(
const ConfigurationInterface* configuration,
const std::string& signal,
int channel,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<AcquisitionInterface> GetAcqBlock(
const ConfigurationInterface* configuration,
const std::string& role,
const std::string& implementation, unsigned int in_streams,
unsigned int in_streams,
unsigned int out_streams);
std::unique_ptr<TrackingInterface> GetTrkBlock(
const ConfigurationInterface* configuration,
const std::string& role,
const std::string& implementation, unsigned int in_streams,
unsigned int in_streams,
unsigned int out_streams);
std::unique_ptr<TelemetryDecoderInterface> GetTlmBlock(
const ConfigurationInterface* configuration,
const std::string& role,
const std::string& implementation, unsigned int in_streams,
unsigned int in_streams,
unsigned int out_streams);
};