mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-11-13 05:20:04 +00:00
Make private member metadata_ a std::shared_pointer
This commit is contained in:
parent
8702f9dfc7
commit
d7885036b6
@ -20,6 +20,7 @@
|
|||||||
#include "gnss_sdr_valve.h"
|
#include "gnss_sdr_valve.h"
|
||||||
#include <gnuradio/blocks/copy.h>
|
#include <gnuradio/blocks/copy.h>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <iostream>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#if USE_GLOG_AND_GFLAGS
|
#if USE_GLOG_AND_GFLAGS
|
||||||
@ -92,10 +93,11 @@ IONGSMSSignalSource::IONGSMSSignalSource(const ConfigurationInterface* configura
|
|||||||
|
|
||||||
void IONGSMSSignalSource::load_metadata()
|
void IONGSMSSignalSource::load_metadata()
|
||||||
{
|
{
|
||||||
|
metadata_ = std::make_shared<GnssMetadata::Metadata>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GnssMetadata::XmlProcessor xml_proc;
|
GnssMetadata::XmlProcessor xml_proc;
|
||||||
if (!xml_proc.Load(metadata_filepath_.c_str(), false, metadata_))
|
if (!xml_proc.Load(metadata_filepath_.c_str(), false, *metadata_))
|
||||||
{
|
{
|
||||||
LOG(WARNING) << "Could not load XML metadata file " << metadata_filepath_;
|
LOG(WARNING) << "Could not load XML metadata file " << metadata_filepath_;
|
||||||
std::cerr << "Could not load XML metadata file " << metadata_filepath_ << std::endl;
|
std::cerr << "Could not load XML metadata file " << metadata_filepath_ << std::endl;
|
||||||
@ -123,9 +125,9 @@ void IONGSMSSignalSource::load_metadata()
|
|||||||
std::vector<IONGSMSFileSource::sptr> IONGSMSSignalSource::make_stream_sources(const std::vector<std::string>& stream_ids) const
|
std::vector<IONGSMSFileSource::sptr> IONGSMSSignalSource::make_stream_sources(const std::vector<std::string>& stream_ids) const
|
||||||
{
|
{
|
||||||
std::vector<IONGSMSFileSource::sptr> sources{};
|
std::vector<IONGSMSFileSource::sptr> sources{};
|
||||||
for (const auto& file : metadata_.Files())
|
for (const auto& file : metadata_->Files())
|
||||||
{
|
{
|
||||||
for (const auto& lane : metadata_.Lanes())
|
for (const auto& lane : metadata_->Lanes())
|
||||||
{
|
{
|
||||||
if (lane.Id() == file.Lane().Id())
|
if (lane.Id() == file.Lane().Id())
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "ion_gsms.h"
|
#include "ion_gsms.h"
|
||||||
#include <GnssMetadata.h>
|
#include <GnssMetadata.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -69,7 +70,7 @@ private:
|
|||||||
std::vector<gnss_shared_ptr<gr::block>> valves_;
|
std::vector<gnss_shared_ptr<gr::block>> valves_;
|
||||||
|
|
||||||
std::string metadata_filepath_;
|
std::string metadata_filepath_;
|
||||||
GnssMetadata::Metadata metadata_;
|
std::shared_ptr<GnssMetadata::Metadata> metadata_;
|
||||||
|
|
||||||
gnss_shared_ptr<Gnss_Sdr_Timestamp> timestamp_block_;
|
gnss_shared_ptr<Gnss_Sdr_Timestamp> timestamp_block_;
|
||||||
std::string timestamp_file_;
|
std::string timestamp_file_;
|
||||||
|
Loading…
Reference in New Issue
Block a user