Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
marenz2569 committed Sep 10, 2024
1 parent 6a72cea commit 5a56403
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
16 changes: 8 additions & 8 deletions include/l2/upper_mac_fragments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class UpperMacDownlinkFragmentation {
/// \param new_state the new state into which the state machine would be transfered with this fragment
/// \param fragment the control plane signalling packet that is fragmented
/// \return an optional reconstructed control plane signalling packet when reconstuction was successful
auto change_state(State new_state,
const UpperMacCPlaneSignallingPacket& fragment) -> std::optional<UpperMacCPlaneSignallingPacket> {
auto change_state(State new_state, const UpperMacCPlaneSignallingPacket& fragment)
-> std::optional<UpperMacCPlaneSignallingPacket> {
const auto& valid_state_changes = allowed_state_changes_[state_];

// increment the total fragment counters
Expand Down Expand Up @@ -152,8 +152,8 @@ class UpperMacDownlinkFragmentation {
/// Push a fragment for reconstruction.
/// \param fragment the control plane signalling packet that is fragmented
/// \return an optional reconstructed control plane signalling packet when reconstuction was successful
auto
push_fragment(const UpperMacCPlaneSignallingPacket& fragment) -> std::optional<UpperMacCPlaneSignallingPacket> {
auto push_fragment(const UpperMacCPlaneSignallingPacket& fragment)
-> std::optional<UpperMacCPlaneSignallingPacket> {
switch (fragment.type_) {
case MacPacketType::kMacResource:
assert(fragment.fragmentation_);
Expand Down Expand Up @@ -211,8 +211,8 @@ class UpperMacUplinkFragmentation {
/// \param new_state the new state into which the state machine would be transfered with this fragment
/// \param fragment the control plane signalling packet that is fragmented
/// \return an optional reconstructed control plane signalling packet when reconstuction was successful
auto change_state(State new_state,
const UpperMacCPlaneSignallingPacket& fragment) -> std::optional<UpperMacCPlaneSignallingPacket> {
auto change_state(State new_state, const UpperMacCPlaneSignallingPacket& fragment)
-> std::optional<UpperMacCPlaneSignallingPacket> {
const auto& address = fragment.address_;
auto& state = state_per_address_[address];
auto& fragments = fragments_per_address_[address];
Expand Down Expand Up @@ -280,8 +280,8 @@ class UpperMacUplinkFragmentation {
/// Push a fragment for reconstruction.
/// \param fragment the control plane signalling packet that is fragmented
/// \return an optional reconstructed control plane signalling packet when reconstuction was successful
auto
push_fragment(const UpperMacCPlaneSignallingPacket& fragment) -> std::optional<UpperMacCPlaneSignallingPacket> {
auto push_fragment(const UpperMacCPlaneSignallingPacket& fragment)
-> std::optional<UpperMacCPlaneSignallingPacket> {
switch (fragment.type_) {
case MacPacketType::kMacResource:
throw std::runtime_error("MacResource is not handled by UpperMacUplinkFragmentation");
Expand Down
12 changes: 6 additions & 6 deletions include/l2/upper_mac_packet_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,22 @@ class UpperMacPacketBuilder {
/// \param channel the logical channel on which the packets are sent
/// \param data the BitVector which holds the packets
/// \return the parsed c-plane signalling packets
[[nodiscard]] static auto parse_c_plane_signalling(BurstType burst_type, LogicalChannel channel,
BitVector&& data) -> std::vector<UpperMacCPlaneSignallingPacket>;
[[nodiscard]] static auto parse_c_plane_signalling(BurstType burst_type, LogicalChannel channel, BitVector&& data)
-> std::vector<UpperMacCPlaneSignallingPacket>;

/// Parse the user plane signalling packet contained in a BitVector
/// \param channel the logical channel on which the packet is sent
/// \param data the BitVector which holds the packet
/// \return the parsed u-plane signalling packet
[[nodiscard]] static auto parse_u_plane_signalling(LogicalChannel channel,
BitVector&& data) -> UpperMacUPlaneSignallingPacket;
[[nodiscard]] static auto parse_u_plane_signalling(LogicalChannel channel, BitVector&& data)
-> UpperMacUPlaneSignallingPacket;

/// Parse the user plane traffic packet contained in a BitVector
/// \param channel the logical channel on which the packet is sent
/// \param data the BitVector which holds the packet
/// \return the parsed u-plane traffic packet
[[nodiscard]] static auto parse_u_plane_traffic(LogicalChannel channel,
BitVector&& data) -> UpperMacUPlaneTrafficPacket;
[[nodiscard]] static auto parse_u_plane_traffic(LogicalChannel channel, BitVector&& data)
-> UpperMacUPlaneTrafficPacket;

public:
UpperMacPacketBuilder() = default;
Expand Down
12 changes: 6 additions & 6 deletions src/l2/upper_mac_packet_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ auto UpperMacPacketBuilder::parse_broadcast(LogicalChannel channel, BitVector&&
}

auto UpperMacPacketBuilder::extract_tm_sdu(BitVector& data, std::size_t preprocessing_bit_count,
unsigned _BitInt(1) fill_bit_indication,
std::optional<std::size_t> length) -> BitVector {
unsigned _BitInt(1) fill_bit_indication, std::optional<std::size_t> length)
-> BitVector {
// 1. calculate the header size of the MAC. this step must be performed before removing fill bits, as this would
// change the number of bits in the BitVector
const auto mac_header_length = preprocessing_bit_count - data.bits_left();
Expand Down Expand Up @@ -527,8 +527,8 @@ auto UpperMacPacketBuilder::parse_c_plane_signalling(const BurstType burst_type,
return packets;
}

auto UpperMacPacketBuilder::parse_u_plane_signalling(const LogicalChannel channel,
BitVector&& data) -> UpperMacUPlaneSignallingPacket {
auto UpperMacPacketBuilder::parse_u_plane_signalling(const LogicalChannel channel, BitVector&& data)
-> UpperMacUPlaneSignallingPacket {
// the only valid packet here is MAC-U-SIGNAL

auto pdu_type = data.take<2>();
Expand All @@ -542,7 +542,7 @@ auto UpperMacPacketBuilder::parse_u_plane_signalling(const LogicalChannel channe
.logical_channel_ = channel, .type_ = MacPacketType::kMacUSignal, .tm_sdu_ = std::move(data)};
}

auto UpperMacPacketBuilder::parse_u_plane_traffic(const LogicalChannel channel,
BitVector&& data) -> UpperMacUPlaneTrafficPacket {
auto UpperMacPacketBuilder::parse_u_plane_traffic(const LogicalChannel channel, BitVector&& data)
-> UpperMacUPlaneTrafficPacket {
return UpperMacUPlaneTrafficPacket{.logical_channel_ = channel, .data_ = std::move(data)};
}

0 comments on commit 5a56403

Please sign in to comment.