1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-08-31 09:57:58 +00:00

Cleanup gnss block factory

This commit is contained in:
Mathieu Favreau
2025-05-07 18:42:54 +00:00
parent e3364a6f12
commit 54f677ff60
4 changed files with 549 additions and 1265 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -57,7 +57,7 @@ public:
std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const ConfigurationInterface* configuration, int ID = -1);
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const ConfigurationInterface* configuration,
std::vector<std::unique_ptr<GNSSBlockInterface>> GetChannels(const ConfigurationInterface* configuration,
Concurrent_Queue<pmt::pmt_t>* queue);
std::unique_ptr<GNSSBlockInterface> GetObservables(const ConfigurationInterface* configuration);

View File

@@ -212,10 +212,10 @@ void GNSSFlowgraph::init()
auto channels = block_factory->GetChannels(configuration_.get(), queue_.get());
channels_count_ = static_cast<int>(channels->size());
channels_count_ = static_cast<int>(channels.size());
for (int i = 0; i < channels_count_; i++)
{
std::shared_ptr<GNSSBlockInterface> chan_ = std::move(channels->at(i));
std::shared_ptr<GNSSBlockInterface> chan_ = std::move(channels.at(i));
channels_.push_back(std::dynamic_pointer_cast<ChannelInterface>(chan_));
}

View File

@@ -394,9 +394,9 @@ TEST(GNSSBlockFactoryTest, InstantiateChannels)
configuration->set_property("TelemetryDecoder_1C.implementation", "GPS_L1_CA_Telemetry_Decoder");
std::shared_ptr<Concurrent_Queue<pmt::pmt_t>> queue = std::make_shared<Concurrent_Queue<pmt::pmt_t>>();
std::unique_ptr<GNSSBlockFactory> factory = std::make_unique<GNSSBlockFactory>();
std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> channels = factory->GetChannels(configuration.get(), queue.get());
EXPECT_EQ(static_cast<unsigned int>(2), channels->size());
channels->erase(channels->begin(), channels->end());
std::vector<std::unique_ptr<GNSSBlockInterface>> channels = factory->GetChannels(configuration.get(), queue.get());
EXPECT_EQ(static_cast<unsigned int>(2), channels.size());
channels.erase(channels.begin(), channels.end());
}