all: mark various function args as const& to avoid pass by value

master
Andre Puschmann 2 years ago
parent 15c6feeba6
commit be40336089

@ -51,7 +51,7 @@ public:
virtual void clear_buffer(uint16_t rnti) = 0; virtual void clear_buffer(uint16_t rnti) = 0;
virtual void add_user(uint16_t rnti) = 0; virtual void add_user(uint16_t rnti) = 0;
virtual void rem_user(uint16_t rnti) = 0; virtual void rem_user(uint16_t rnti) = 0;
virtual void add_bearer(uint16_t rnti, uint32_t lcid, srsran::rlc_config_t cnfg) = 0; virtual void add_bearer(uint16_t rnti, uint32_t lcid, const srsran::rlc_config_t& cnfg) = 0;
virtual void add_bearer_mrb(uint16_t rnti, uint32_t lcid) = 0; virtual void add_bearer_mrb(uint16_t rnti, uint32_t lcid) = 0;
virtual void del_bearer(uint16_t rnti, uint32_t lcid) = 0; virtual void del_bearer(uint16_t rnti, uint32_t lcid) = 0;
virtual void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu) = 0; virtual void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu) = 0;

@ -47,7 +47,7 @@ public:
void clear_buffer(uint16_t rnti); void clear_buffer(uint16_t rnti);
void add_user(uint16_t rnti); void add_user(uint16_t rnti);
void rem_user(uint16_t rnti); void rem_user(uint16_t rnti);
void add_bearer(uint16_t rnti, uint32_t lcid, srsran::rlc_config_t cnfg); void add_bearer(uint16_t rnti, uint32_t lcid, const srsran::rlc_config_t& cnfg);
void add_bearer_mrb(uint16_t rnti, uint32_t lcid); void add_bearer_mrb(uint16_t rnti, uint32_t lcid);
void del_bearer(uint16_t rnti, uint32_t lcid); void del_bearer(uint16_t rnti, uint32_t lcid);
bool has_bearer(uint16_t rnti, uint32_t lcid); bool has_bearer(uint16_t rnti, uint32_t lcid);

@ -155,7 +155,7 @@ bool rrc::ue::rrc_endc::fill_conn_recfg(asn1::rrc::rrc_conn_recfg_r8_ies_s* conn
meas_cfg.meas_id_to_rem_list.resize(1); meas_cfg.meas_id_to_rem_list.resize(1);
meas_cfg.meas_id_to_rem_list[0] = nr_meas_id; meas_cfg.meas_id_to_rem_list[0] = nr_meas_id;
// FIXME: use bearer manager to remove EUTRA DRB // TODO: use bearer manager to remove EUTRA DRB
conn_recfg->rr_cfg_ded.drb_to_release_list_present = true; conn_recfg->rr_cfg_ded.drb_to_release_list_present = true;
conn_recfg->rr_cfg_ded.drb_to_release_list.resize(1); conn_recfg->rr_cfg_ded.drb_to_release_list.resize(1);
conn_recfg->rr_cfg_ded.drb_to_release_list[0] = 1; conn_recfg->rr_cfg_ded.drb_to_release_list[0] = 1;

@ -103,7 +103,7 @@ void rlc::clear_buffer(uint16_t rnti)
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
} }
void rlc::add_bearer(uint16_t rnti, uint32_t lcid, srsran::rlc_config_t cnfg) void rlc::add_bearer(uint16_t rnti, uint32_t lcid, const srsran::rlc_config_t& cnfg)
{ {
pthread_rwlock_rdlock(&rwlock); pthread_rwlock_rdlock(&rwlock);
if (users.count(rnti)) { if (users.count(rnti)) {

@ -24,7 +24,7 @@ public:
void clear_buffer(uint16_t rnti) override {} void clear_buffer(uint16_t rnti) override {}
void add_user(uint16_t rnti) override {} void add_user(uint16_t rnti) override {}
void rem_user(uint16_t rnti) override {} void rem_user(uint16_t rnti) override {}
void add_bearer(uint16_t rnti, uint32_t lcid, srsran::rlc_config_t cnfg) override {} void add_bearer(uint16_t rnti, uint32_t lcid, const srsran::rlc_config_t& cnfg) override {}
void add_bearer_mrb(uint16_t rnti, uint32_t lcid) override {} void add_bearer_mrb(uint16_t rnti, uint32_t lcid) override {}
void del_bearer(uint16_t rnti, uint32_t lcid) override {} void del_bearer(uint16_t rnti, uint32_t lcid) override {}
void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu) override { last_sdu = std::move(sdu); } void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu) override { last_sdu = std::move(sdu); }

@ -642,7 +642,7 @@ srsran::byte_buffer_t* mac_nr::assemble_rar(srsran::const_span<sched_nr_interfac
{ {
srsran::mac_rar_pdu_nr rar_pdu; srsran::mac_rar_pdu_nr rar_pdu;
uint32_t pdsch_tbs = 10; // FIXME: how big is the PDSCH? uint32_t pdsch_tbs = 10; // TODO: how big is the PDSCH?
rar_pdu.init_tx(rar_pdu_buffer.get(), pdsch_tbs); rar_pdu.init_tx(rar_pdu_buffer.get(), pdsch_tbs);
for (auto& rar_grant : grants) { for (auto& rar_grant : grants) {

@ -271,7 +271,7 @@ private:
* @param rx_gain_offset Provides last received rx_gain_offset * @param rx_gain_offset Provides last received rx_gain_offset
* @return True if the measurement functions are executed without errors, otherwise false * @return True if the measurement functions are executed without errors, otherwise false
*/ */
virtual bool measure_rat(measure_context_t context, std::vector<cf_t>& buffer, float rx_gain_offset) = 0; virtual bool measure_rat(const measure_context_t& context, std::vector<cf_t>& buffer, float rx_gain_offset) = 0;
/** /**
* @brief Measurement process helper method. Encapsulates the neighbour cell measurement functionality * @brief Measurement process helper method. Encapsulates the neighbour cell measurement functionality

@ -70,7 +70,7 @@ private:
* @param rx_gain_offset Provides last received rx_gain_offset * @param rx_gain_offset Provides last received rx_gain_offset
* @return True if no error happens, otherwise false * @return True if no error happens, otherwise false
*/ */
bool measure_rat(measure_context_t context, std::vector<cf_t>& buffer, float rx_gain_offset) override; bool measure_rat(const measure_context_t& context, std::vector<cf_t>& buffer, float rx_gain_offset) override;
srslog::basic_logger& logger; srslog::basic_logger& logger;
srsran_cell_t serving_cell = {}; ///< Current serving cell in the EARFCN, to avoid reporting it srsran_cell_t serving_cell = {}; ///< Current serving cell in the EARFCN, to avoid reporting it

@ -109,7 +109,7 @@ private:
* @param rx_gain_offset Provides last received rx_gain_offset * @param rx_gain_offset Provides last received rx_gain_offset
* @return True if no error happen, otherwise false * @return True if no error happen, otherwise false
*/ */
bool measure_rat(measure_context_t context, std::vector<cf_t>& buffer, float rx_gain_offset) override; bool measure_rat(const measure_context_t& context, std::vector<cf_t>& buffer, float rx_gain_offset) override;
srslog::basic_logger& logger; srslog::basic_logger& logger;
uint32_t cc_idx = 0; uint32_t cc_idx = 0;

@ -81,8 +81,8 @@ class rrc_nr::connection_setup_proc
{ {
public: public:
explicit connection_setup_proc(rrc_nr& parent_); explicit connection_setup_proc(rrc_nr& parent_);
srsran::proc_outcome_t init(const asn1::rrc_nr::radio_bearer_cfg_s radio_bearer_cfg_, srsran::proc_outcome_t init(const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg_,
const asn1::rrc_nr::cell_group_cfg_s cell_group_, const asn1::rrc_nr::cell_group_cfg_s& cell_group_,
srsran::unique_byte_buffer_t dedicated_info_nas_); srsran::unique_byte_buffer_t dedicated_info_nas_);
srsran::proc_outcome_t step() { return srsran::proc_outcome_t::yield; } srsran::proc_outcome_t step() { return srsran::proc_outcome_t::yield; }
static const char* name() { return "Connection Setup"; } static const char* name() { return "Connection Setup"; }

@ -48,7 +48,7 @@ class nas_5g::pdu_session_establishment_procedure
{ {
public: public:
explicit pdu_session_establishment_procedure(nas_5g_interface_procedures* parent_nas_, srslog::basic_logger& logger_); explicit pdu_session_establishment_procedure(nas_5g_interface_procedures* parent_nas_, srslog::basic_logger& logger_);
srsran::proc_outcome_t init(const uint16_t pdu_session_id, const pdu_session_cfg_t pdu_session); srsran::proc_outcome_t init(const uint16_t pdu_session_id, const pdu_session_cfg_t& pdu_session);
srsran::proc_outcome_t react(const srsran::nas_5g::pdu_session_establishment_accept_t& pdu_session_est_accept); srsran::proc_outcome_t react(const srsran::nas_5g::pdu_session_establishment_accept_t& pdu_session_est_accept);
srsran::proc_outcome_t react(const srsran::nas_5g::pdu_session_establishment_reject_t& pdu_session_est_reject); srsran::proc_outcome_t react(const srsran::nas_5g::pdu_session_establishment_reject_t& pdu_session_est_reject);
srsran::proc_outcome_t step(); srsran::proc_outcome_t step();

@ -50,7 +50,7 @@ void intra_measure_lte::set_primary_cell(uint32_t earfcn, srsran_cell_t cell)
set_current_sf_len((uint32_t)SRSRAN_SF_LEN_PRB(cell.nof_prb)); set_current_sf_len((uint32_t)SRSRAN_SF_LEN_PRB(cell.nof_prb));
} }
bool intra_measure_lte::measure_rat(measure_context_t context, std::vector<cf_t>& buffer, float rx_gain_offset) bool intra_measure_lte::measure_rat(const measure_context_t& context, std::vector<cf_t>& buffer, float rx_gain_offset)
{ {
std::set<uint32_t> cells_to_measure = context.active_pci; std::set<uint32_t> cells_to_measure = context.active_pci;

@ -81,7 +81,7 @@ bool intra_measure_nr::set_config(const config_t& cfg)
return true; return true;
} }
bool intra_measure_nr::measure_rat(const measure_context_t context, std::vector<cf_t>& buffer, float rx_gain_offset) bool intra_measure_nr::measure_rat(const measure_context_t& context, std::vector<cf_t>& buffer, float rx_gain_offset)
{ {
std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();

@ -308,8 +308,8 @@ rrc_nr::connection_setup_proc::connection_setup_proc(srsue::rrc_nr& parent_) :
rrc_handle(parent_), logger(srslog::fetch_basic_logger("RRC-NR")) rrc_handle(parent_), logger(srslog::fetch_basic_logger("RRC-NR"))
{} {}
srsran::proc_outcome_t rrc_nr::connection_setup_proc::init(const asn1::rrc_nr::radio_bearer_cfg_s radio_bearer_cfg_, srsran::proc_outcome_t rrc_nr::connection_setup_proc::init(const asn1::rrc_nr::radio_bearer_cfg_s& radio_bearer_cfg_,
const asn1::rrc_nr::cell_group_cfg_s cell_group_, const asn1::rrc_nr::cell_group_cfg_s& cell_group_,
srsran::unique_byte_buffer_t dedicated_info_nas_) srsran::unique_byte_buffer_t dedicated_info_nas_)
{ {
Info("Starting..."); Info("Starting...");

@ -43,7 +43,7 @@ nas_5g::pdu_session_establishment_procedure::pdu_session_establishment_procedure
{} {}
srsran::proc_outcome_t nas_5g::pdu_session_establishment_procedure::init(const uint16_t pdu_session_id_, srsran::proc_outcome_t nas_5g::pdu_session_establishment_procedure::init(const uint16_t pdu_session_id_,
const pdu_session_cfg_t pdu_session_cfg) const pdu_session_cfg_t& pdu_session_cfg)
{ {
// Get PDU transaction identity // Get PDU transaction identity
transaction_identity = parent_nas->allocate_next_proc_trans_id(); transaction_identity = parent_nas->allocate_next_proc_trans_id();

Loading…
Cancel
Save