Skip to content

Commit

Permalink
optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Aug 13, 2023
1 parent c66ea8d commit e724f92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion executables/unit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <string>

#include "../src/FECStream.h"
//#include "../src/FECEnabled.hpp"
#include "../src/FEC.hpp"

#include "../src/Encryption.h"
#include "../src/HelperSources/Helper.hpp"
Expand Down
8 changes: 8 additions & 0 deletions src/FECStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ void FECEncoder::encode_block(
}
}

RxBlock::RxBlock(const unsigned int maxNFragmentsPerBlock,
const uint64_t blockIdx1)
:blockIdx(blockIdx1),
fragment_map(maxNFragmentsPerBlock,FRAGMENT_STATUS_UNAVAILABLE), //after creation of the RxBlock every f. is marked as unavailable
blockBuffer(maxNFragmentsPerBlock) {
assert(fragment_map.size() == blockBuffer.size());
}

bool RxBlock::hasFragment(const int fragment_idx) {
assert(fragment_idx<fragment_map.size());
return fragment_map[fragment_idx] == FRAGMENT_STATUS_AVAILABLE;
Expand Down
9 changes: 2 additions & 7 deletions src/FECStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#define WIFIBROADCAST_FECSTREAM_H

#include <array>
#include <cassert>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "FEC.hpp"
#include "HelperSources/TimeHelper.hpp"

/**
Expand Down Expand Up @@ -103,12 +103,7 @@ class RxBlock {
// @param maxNFragmentsPerBlock max number of primary and secondary fragments for this block.
// you could just use MAX_TOTAL_FRAGMENTS_PER_BLOCK for that, but if your tx then uses (4:8) for example, you'd
// allocate much more memory every time for a new RX block than needed.
explicit RxBlock(const unsigned int maxNFragmentsPerBlock, const uint64_t blockIdx1)
:blockIdx(blockIdx1),
fragment_map(maxNFragmentsPerBlock,FRAGMENT_STATUS_UNAVAILABLE), //after creation of the RxBlock every f. is marked as unavailable
blockBuffer(maxNFragmentsPerBlock) {
assert(fragment_map.size() == blockBuffer.size());
}
explicit RxBlock(unsigned int maxNFragmentsPerBlock, uint64_t blockIdx1);
// No copy constructor for safety
RxBlock(const RxBlock &) = delete;
// two blocks are the same if they refer to the same block idx:
Expand Down

0 comments on commit e724f92

Please sign in to comment.