aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf_dl.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-11-17 20:57:34 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2022-11-18 14:16:56 +0100
commit1e1275faeeca3a92cd49ee58cc42600522131ad4 (patch)
treeebe3b6b15b338a8d722e616aefaf3d09f4a135e9 /src/tbf_dl.cpp
parentac9ee9aa8d1ed67d43a30be2efe0760b078f85bd (diff)
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
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r--src/tbf_dl.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index e088e65e..50066755 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1272,3 +1272,11 @@ struct gprs_rlcmac_dl_tbf *tbf_as_dl_tbf(struct gprs_rlcmac_tbf *tbf)
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;
+}