libflute
|
Represents a file being transmitted or received. More...
#include <File.h>
Public Member Functions | |
File (LibFlute::FileDeliveryTable::FileEntry entry) | |
Create a file from an FDT entry (used for reception) More... | |
File (uint32_t toi, FecOti fec_oti, std::string content_location, std::string content_type, uint64_t expires, char *data, size_t length, bool copy_data=false) | |
Create a file from the given parameters (used for transmission) More... | |
virtual | ~File () |
Default destructor. More... | |
void | put_symbol (const EncodingSymbol &symbol) |
Write the data from an encoding symbol into the appropriate place in the buffer. More... | |
bool | complete () const |
Check if the file is complete. More... | |
char * | buffer () const |
Get the data buffer. More... | |
size_t | length () const |
Get the data buffer length. More... | |
const FecOti & | fec_oti () const |
Get the FEC OTI values. More... | |
const LibFlute::FileDeliveryTable::FileEntry & | meta () const |
Get the file metadata from its FDT entry. More... | |
unsigned long | received_at () const |
Timestamp of file reception. More... | |
void | log_access () |
Log access to the file by incrementing a counter. More... | |
unsigned | access_count () const |
Get the access counter value. More... | |
std::vector< EncodingSymbol > | get_next_symbols (size_t max_size) |
Get the next encoding symbols that fit in max_size bytes. More... | |
void | mark_completed (const std::vector< EncodingSymbol > &symbols, bool success) |
Mark encoding symbols as completed. More... | |
void | set_fdt_instance_id (uint16_t id) |
Set the FDT instance ID. More... | |
uint16_t | fdt_instance_id () |
Get the FDT instance ID. More... | |
LibFlute::File::File | ( | LibFlute::FileDeliveryTable::FileEntry | entry | ) |
LibFlute::File::File | ( | uint32_t | toi, |
FecOti | fec_oti, | ||
std::string | content_location, | ||
std::string | content_type, | ||
uint64_t | expires, | ||
char * | data, | ||
size_t | length, | ||
bool | copy_data = false |
||
) |
Create a file from the given parameters (used for transmission)
toi | TOI of the file |
content_location | Content location URI to use |
content_type | MIME type |
expires | Expiry value (in seconds since the NTP epoch) |
data | Pointer to the data buffer |
length | Length of the buffer |
copy_data | Copy the buffer. If false (the default), the caller must ensure the buffer remains valid while the file is being transmitted. |
Definition at line 47 of file File.cpp.
|
virtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
auto LibFlute::File::get_next_symbols | ( | size_t | max_size | ) |
Get the next encoding symbols that fit in max_size bytes.
Definition at line 189 of file File.cpp.
|
inline |
|
inline |
auto LibFlute::File::mark_completed | ( | const std::vector< EncodingSymbol > & | symbols, |
bool | success | ||
) |
|
inline |
auto LibFlute::File::put_symbol | ( | const EncodingSymbol & | symbol | ) |
|
inline |
|
inline |