forked from srsran/srsRAN_Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rlc: move rlc_buffer_state into own header file
- Loading branch information
1 parent
abaf622
commit a52bbdf
Showing
4 changed files
with
52 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* | ||
* Copyright 2021-2025 Software Radio Systems Limited | ||
* | ||
* By using this file, you agree to the terms and conditions set | ||
* forth in the LICENSE file which can be found at the top level of | ||
* the distribution. | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "fmt/format.h" | ||
#include <chrono> | ||
#include <optional> | ||
|
||
namespace srsran { | ||
|
||
/// Structure used to represent RLC buffer state. | ||
/// The buffer state is transmitted towards lower layers (i.e. the MAC and the scheduler). | ||
/// It includes the amount of data pending for transmission (queued SDUs, headers, and for RLC AM, ReTx and status PDUs) | ||
/// and the time of arrival of the oldest PDU among those queues. | ||
struct rlc_buffer_state { | ||
/// Amount of bytes pending for transmission. | ||
unsigned pending_bytes = 0; | ||
/// Head of line (HOL) time of arrival (TOA) holds the TOA of the oldest SDU or ReTx that is queued for transmission. | ||
std::optional<std::chrono::system_clock::time_point> hol_toa; | ||
}; | ||
} // namespace srsran | ||
|
||
namespace fmt { | ||
|
||
// associated formatter | ||
template <> | ||
struct formatter<srsran::rlc_buffer_state> { | ||
template <typename ParseContext> | ||
auto parse(ParseContext& ctx) | ||
{ | ||
return ctx.begin(); | ||
} | ||
|
||
template <typename FormatContext> | ||
auto format(const srsran::rlc_buffer_state& bs, FormatContext& ctx) const | ||
{ | ||
return format_to(ctx.out(), "pending_bytes={} hol_toa={}", bs.pending_bytes, bs.hol_toa); | ||
} | ||
}; | ||
} // namespace fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters