window: move encoding into functions

* move window size encoding and writing into separate functions
* introduce necessary TBF wrappers to avoid direct m_window access

This is part of preparation work to move to separate UL/DL windows.

Related: OS#1759
Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 2863151..40cb313 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -2214,9 +2214,9 @@
 	fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n",
 		dl_tbf->dl_slots(),
 		pcu_bitcount(dl_tbf->dl_slots()),
-		dl_tbf->window()->ws());
+		dl_tbf->window_size());
 	OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4);
-	OSMO_ASSERT(dl_tbf->window()->ws() == 64);
+	OSMO_ASSERT(dl_tbf->window_size() == 64);
 	tbf_free(dl_tbf);
 
 	/* EGPRS-only */
@@ -2229,9 +2229,9 @@
 	fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n",
 		dl_tbf->dl_slots(),
 		pcu_bitcount(dl_tbf->dl_slots()),
-		dl_tbf->window()->ws());
+		dl_tbf->window_size());
 	OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4);
-	OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 4 * 64);
+	OSMO_ASSERT(dl_tbf->window_size() == 128 + 4 * 64);
 	tbf_free(dl_tbf);
 
 	printf("=== end %s ===\n", __func__);
@@ -2273,9 +2273,9 @@
 	fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n",
 		dl_tbf->dl_slots(),
 		pcu_bitcount(dl_tbf->dl_slots()),
-		dl_tbf->window()->ws());
+		dl_tbf->window_size());
 	OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 1);
-	OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 1 * 64);
+	OSMO_ASSERT(dl_tbf->window_size() == 128 + 1 * 64);
 
 	dl_tbf->update();
 
@@ -2284,9 +2284,9 @@
 	fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n",
 		dl_tbf->dl_slots(),
 		pcu_bitcount(dl_tbf->dl_slots()),
-		dl_tbf->window()->ws());
+		dl_tbf->window_size());
 	OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4);
-	OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 4 * 64);
+	OSMO_ASSERT(dl_tbf->window_size() == 128 + 4 * 64);
 
 	tbf_free(dl_tbf);