tbf: Add tbf_as_{ul,dl}_tbf_const func helpers
This way we can easily get the subclass from the parent if the pointer
is const. Similar to what we already have for the opposite direction
{ul,dl}_tbf_as_tbf_const().
Change-Id: I35e650d13ecf3a5020d136e7d8d99837786503e2
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index e088e65..5006675 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1272,3 +1272,11 @@
else
return NULL;
}
+
+const struct gprs_rlcmac_dl_tbf *tbf_as_dl_tbf_const(const struct gprs_rlcmac_tbf *tbf)
+{
+ if (tbf && tbf->direction == GPRS_RLCMAC_DL_TBF)
+ return static_cast<const gprs_rlcmac_dl_tbf *>(tbf);
+ else
+ return NULL;
+}