Changed logger initialization in RLC AM entities

This commit is contained in:
Pedro Alvarez 2021-07-28 12:26:11 +01:00
parent 022c51493b
commit 476f9e1156
5 changed files with 255 additions and 250 deletions

View File

@ -125,6 +125,8 @@ protected:
class rlc_am_base_tx
{
public:
explicit rlc_am_base_tx(srslog::basic_logger* logger_) : logger(logger_) {}
virtual bool configure(const rlc_config_t& cfg_) = 0;
virtual void reestablish() = 0;
virtual void stop() = 0;
@ -140,9 +142,10 @@ protected:
int write_sdu(unique_byte_buffer_t sdu);
byte_buffer_pool* pool = nullptr;
bool tx_enabled = false;
std::string rb_name;
bool tx_enabled = false;
byte_buffer_pool* pool = nullptr;
srslog::basic_logger* logger;
std::string rb_name;
bsr_callback_t bsr_callback;
@ -161,12 +164,17 @@ protected:
class rlc_am_base_rx
{
public:
explicit rlc_am_base_rx(srslog::basic_logger* logger_) : logger(logger_) {}
virtual bool configure(const rlc_config_t& cfg_) = 0;
virtual void reestablish() = 0;
virtual void stop() = 0;
virtual void write_pdu(uint8_t* payload, uint32_t nof_bytes) = 0;
virtual uint32_t get_sdu_rx_latency_ms() = 0;
virtual uint32_t get_rx_buffered_bytes() = 0;
srslog::basic_logger* logger;
byte_buffer_pool* pool = nullptr;
};
rlc_am_base_tx* tx_base = nullptr;

View File

@ -145,7 +145,6 @@ public:
rlc_am_lte* parent = nullptr;
byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
rlc_am_pdu_segment_pool segment_pool;
/****************************************************************************
@ -234,9 +233,8 @@ public:
bool add_segment_and_check(rlc_amd_rx_pdu_segments_t* pdu, rlc_amd_rx_pdu* segment);
void reset_status();
rlc_am_lte* parent = nullptr;
byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
rlc_am_lte* parent = nullptr;
byte_buffer_pool* pool = nullptr;
/****************************************************************************
* Configurable parameters

View File

@ -61,9 +61,7 @@ public:
void get_buffer_state(uint32_t& tx_queue, uint32_t& prio_tx_queue);
private:
rlc_am_nr* parent = nullptr;
byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
rlc_am_nr* parent = nullptr;
/****************************************************************************
* Configurable parameters
@ -100,9 +98,8 @@ public:
uint32_t get_rx_buffered_bytes();
private:
rlc_am_nr* parent = nullptr;
byte_buffer_pool* pool = nullptr;
srslog::basic_logger& logger;
rlc_am_nr* parent = nullptr;
byte_buffer_pool* pool = nullptr;
/****************************************************************************
* Configurable parameters

File diff suppressed because it is too large Load Diff

View File

@ -27,19 +27,19 @@ rlc_am_nr::rlc_am_nr(srslog::basic_logger& logger,
srsue::pdcp_interface_rlc* pdcp_,
srsue::rrc_interface_rlc* rrc_,
srsran::timer_handler* timers_) :
rlc_am_base(logger, lcid_, pdcp_, rrc_, timers_, new rlc_am_nr::rlc_am_nr_tx(this), new rlc_am_nr::rlc_am_nr_rx(this))
rlc_am_base(logger, lcid_, pdcp_, rrc_, timers_, nullptr, nullptr)
{
tx = dynamic_cast<rlc_am_nr::rlc_am_nr_tx*>(tx_base);
rx = dynamic_cast<rlc_am_nr::rlc_am_nr_rx*>(rx_base);
tx = new rlc_am_nr::rlc_am_nr_tx(this);
rx = new rlc_am_nr::rlc_am_nr_rx(this);
tx_base = tx;
rx_base = rx;
}
/*******************************
* RLC AM NR
* Tx subclass implementation
***************************************************************************/
rlc_am_nr::rlc_am_nr_tx::rlc_am_nr_tx(rlc_am_nr* parent_) :
parent(parent_), logger(parent_->logger), pool(byte_buffer_pool::get_instance())
{}
rlc_am_nr::rlc_am_nr_tx::rlc_am_nr_tx(rlc_am_nr* parent_) : parent(parent_), rlc_am_base_tx(&parent_->logger) {}
bool rlc_am_nr::rlc_am_nr_tx::configure(const rlc_config_t& cfg_)
{
@ -98,7 +98,7 @@ void rlc_am_nr::rlc_am_nr_tx::stop() {}
* Rx subclass implementation
***************************************************************************/
rlc_am_nr::rlc_am_nr_rx::rlc_am_nr_rx(rlc_am_nr* parent_) :
parent(parent_), logger(parent_->logger), pool(byte_buffer_pool::get_instance())
parent(parent_), pool(byte_buffer_pool::get_instance()), rlc_am_base_rx(&parent_->logger)
{}
bool rlc_am_nr::rlc_am_nr_rx::configure(const rlc_config_t& cfg_)