tbf: Use LListHead instead of llist_pods
LListHead does basically the same like llist_pods, but more C++ish
and with type safety.
This commit turns the former list field of gprs_rlcmac_tbf into a
private field, provides accessors, moves the related code from
pcu_vty.c to pcu_vty_functions.cpp, and removes the llist_pods
type and related code.
Sponsored-by: On-Waves ehf
diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp
index 8108f74..54e3bc7 100644
--- a/src/poll_controller.cpp
+++ b/src/poll_controller.cpp
@@ -30,14 +30,14 @@
void PollController::expireTimedout(int frame_number, unsigned max_delay)
{
- struct gprs_rlcmac_bts *bts = m_bts.bts_data();
struct gprs_rlcmac_dl_tbf *dl_tbf;
struct gprs_rlcmac_ul_tbf *ul_tbf;
struct gprs_rlcmac_sba *sba, *sba2;
- struct llist_pods *lpods;
+ LListHead<gprs_rlcmac_tbf> *pos;
uint32_t elapsed;
- llist_pods_for_each_entry(ul_tbf, &bts->ul_tbfs, list, lpods) {
+ llist_for_each(pos, &m_bts.ul_tbfs()) {
+ ul_tbf = as_ul_tbf(pos->entry());
if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) {
elapsed = (frame_number + 2715648 - ul_tbf->poll_fn)
% 2715648;
@@ -45,7 +45,8 @@
ul_tbf->poll_timeout();
}
}
- llist_pods_for_each_entry(dl_tbf, &bts->dl_tbfs, list, lpods) {
+ llist_for_each(pos, &m_bts.dl_tbfs()) {
+ dl_tbf = as_dl_tbf(pos->entry());
if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) {
elapsed = (frame_number + 2715648 - dl_tbf->poll_fn)
% 2715648;