54 std::string content_location,
55 std::string content_type,
59 bool copy_data =
false);
79 char*
buffer()
const {
return _buffer; };
119 void mark_completed(
const std::vector<EncodingSymbol>& symbols,
bool success);
132 void calculate_partitioning();
133 void create_blocks();
143 std::map<uint16_t, Symbol> symbols;
146 void check_source_block_completion(SourceBlock& block);
147 void check_file_completion();
149 std::map<uint16_t, SourceBlock> _source_blocks;
151 bool _complete =
false;;
153 uint32_t _nof_source_symbols = 0;
154 uint32_t _nof_source_blocks = 0;
155 uint32_t _nof_large_source_blocks = 0;
156 uint32_t _large_source_block_length = 0;
157 uint32_t _small_source_block_length = 0;
159 char* _buffer =
nullptr;
160 bool _own_buffer =
false;
163 unsigned long _received_at;
164 unsigned _access_count = 0;
166 uint16_t _fdt_instance_id = 0;
A class for handling FEC encoding symbols.
Represents a file being transmitted or received.
const FecOti & fec_oti() const
Get the FEC OTI values.
bool complete() const
Check if the file is complete.
void put_symbol(const EncodingSymbol &symbol)
Write the data from an encoding symbol into the appropriate place in the buffer.
unsigned access_count() const
Get the access counter value.
size_t length() const
Get the data buffer length.
virtual ~File()
Default destructor.
char * buffer() const
Get the data buffer.
uint16_t fdt_instance_id()
Get the FDT instance ID.
File(LibFlute::FileDeliveryTable::FileEntry entry)
Create a file from an FDT entry (used for reception)
void mark_completed(const std::vector< EncodingSymbol > &symbols, bool success)
Mark encoding symbols as completed.
void log_access()
Log access to the file by incrementing a counter.
void set_fdt_instance_id(uint16_t id)
Set the FDT instance ID.
std::vector< EncodingSymbol > get_next_symbols(size_t max_size)
Get the next encoding symbols that fit in max_size bytes.
unsigned long received_at() const
Timestamp of file reception.
const LibFlute::FileDeliveryTable::FileEntry & meta() const
Get the file metadata from its FDT entry.
An entry for a file in the FDT.