diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-12-28 19:15:40 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-01 13:58:13 +0100 |
commit | ed2dbf6954b9883218f5ace1d801c0e316df912a (patch) | |
tree | 1f8a44144bacbad9ca3d7bd947a5a2c8d1cbd726 /src/poll_controller.cpp | |
parent | bf49f042d432780fe37c53aed5e4e3f34ac80793 (diff) |
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
Diffstat (limited to 'src/poll_controller.cpp')
-rw-r--r-- | src/poll_controller.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index 8108f742..54e3bc76 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -30,14 +30,14 @@ PollController::PollController(BTS& bts) 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 @@ void PollController::expireTimedout(int frame_number, unsigned max_delay) 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; |