1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-05-13 12:54:09 +00:00

pass vectors by reference

This commit is contained in:
Carles Fernandez 2015-06-12 17:54:02 +02:00
parent 24c75a19db
commit edb636cf2c
2 changed files with 10 additions and 10 deletions

View File

@ -324,7 +324,7 @@ void gps_l2_m_telemetry_decoder_cc::symbol_aligner_and_decoder::reset()
} }
bool gps_l2_m_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector<double> symbols, std::vector<int> &bits) bool gps_l2_m_telemetry_decoder_cc::symbol_aligner_and_decoder::get_bits(const std::vector<double> & symbols, std::vector<int> & bits)
{ {
const int traceback_depth = 5 * d_KK; const int traceback_depth = 5 * d_KK;
int nbits_requested = symbols.size() / GPS_L2_SYMBOLS_PER_BIT; int nbits_requested = symbols.size() / GPS_L2_SYMBOLS_PER_BIT;
@ -370,7 +370,7 @@ void gps_l2_m_telemetry_decoder_cc::frame_detector::reset()
} }
void gps_l2_m_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector<int> bits, std::vector<std::pair<int,std::vector<int>>> &msg_candidates) void gps_l2_m_telemetry_decoder_cc::frame_detector::get_frame_candidates(const std::vector<int> & bits, std::vector<std::pair<int,std::vector<int>>> & msg_candidates)
{ {
//std::stringstream ss; //std::stringstream ss;
unsigned int cnav_msg_length = 300; unsigned int cnav_msg_length = 300;
@ -434,7 +434,7 @@ void gps_l2_m_telemetry_decoder_cc::crc_verifier::reset()
} }
void gps_l2_m_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector<msg_candiate_int_t> msg_candidates, std::vector<msg_candiate_int_t> &valid_msgs) void gps_l2_m_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::vector<msg_candiate_int_t> & msg_candidates, std::vector<msg_candiate_int_t> & valid_msgs)
{ {
std::vector <unsigned char> tmp_msg; std::vector <unsigned char> tmp_msg;
LOG(INFO) << "get_valid_frames(): " << "msg_candidates.size()=" << msg_candidates.size(); LOG(INFO) << "get_valid_frames(): " << "msg_candidates.size()=" << msg_candidates.size();
@ -461,7 +461,7 @@ void gps_l2_m_telemetry_decoder_cc::crc_verifier::get_valid_frames(const std::ve
void gps_l2_m_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector<int> msg_candidate, std::vector<unsigned char> &bytes) void gps_l2_m_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_bytes(const std::vector<int> & msg_candidate, std::vector<unsigned char> & bytes)
{ {
//std::stringstream ss; //std::stringstream ss;
const size_t bits_per_byte = 8; const size_t bits_per_byte = 8;
@ -488,7 +488,7 @@ void gps_l2_m_telemetry_decoder_cc::crc_verifier::zerropad_back_and_convert_to_b
void gps_l2_m_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector<int> msg_candidate, std::vector<unsigned char> &bytes) void gps_l2_m_telemetry_decoder_cc::crc_verifier::zerropad_front_and_convert_to_bytes(const std::vector<int> & msg_candidate, std::vector<unsigned char> & bytes)
{ {
//std::stringstream ss; //std::stringstream ss;
const size_t bits_per_byte = 8; const size_t bits_per_byte = 8;

View File

@ -127,7 +127,7 @@ private:
symbol_aligner_and_decoder(); symbol_aligner_and_decoder();
~symbol_aligner_and_decoder(); ~symbol_aligner_and_decoder();
void reset(); void reset();
bool get_bits(const std::vector<double> symbols, std::vector<int> &bits); bool get_bits(const std::vector<double> & symbols, std::vector<int> & bits);
private: private:
int d_KK; int d_KK;
Viterbi_Decoder * d_vd1; Viterbi_Decoder * d_vd1;
@ -141,7 +141,7 @@ private:
{ {
public: public:
void reset(); void reset();
void get_frame_candidates(const std::vector<int> bits, std::vector<std::pair<int, std::vector<int>>> &msg_candidates); void get_frame_candidates(const std::vector<int> & bits, std::vector<std::pair<int, std::vector<int>>> & msg_candidates);
private: private:
std::deque<int> d_buffer; std::deque<int> d_buffer;
} d_frame_detector; } d_frame_detector;
@ -152,12 +152,12 @@ private:
{ {
public: public:
void reset(); void reset();
void get_valid_frames(const std::vector<msg_candiate_int_t> msg_candidates, std::vector<msg_candiate_int_t> &valid_msgs); void get_valid_frames(const std::vector<msg_candiate_int_t> & msg_candidates, std::vector<msg_candiate_int_t> & valid_msgs);
private: private:
typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> crc_24_q_type; typedef boost::crc_optimal<24, 0x1864CFBu, 0x0, 0x0, false, false> crc_24_q_type;
crc_24_q_type d_checksum_agent; crc_24_q_type d_checksum_agent;
void zerropad_front_and_convert_to_bytes(const std::vector<int> msg_candidate, std::vector<unsigned char> &bytes); void zerropad_front_and_convert_to_bytes(const std::vector<int> & msg_candidate, std::vector<unsigned char> & bytes);
void zerropad_back_and_convert_to_bytes(const std::vector<int> msg_candidate, std::vector<unsigned char> &bytes); void zerropad_back_and_convert_to_bytes(const std::vector<int> & msg_candidate, std::vector<unsigned char> & bytes);
} d_crc_verifier; } d_crc_verifier;
Gps_CNAV_Navigation_Message d_CNAV_Message; Gps_CNAV_Navigation_Message d_CNAV_Message;