libflute
include
FileDeliveryTable.h
Go to the documentation of this file.
1
// libflute - FLUTE/ALC library
2
//
3
// Copyright (C) 2021 Klaus Kühnhammer (Österreichische Rundfunksender GmbH & Co KG)
4
//
5
// This program is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU Affero General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU Affero General Public License for more details.
14
//
15
// You should have received a copy of the GNU Affero General Public License
16
// along with this program. If not, see <http://www.gnu.org/licenses/>.
17
//
18
#pragma once
19
#include <stddef.h>
20
#include <stdint.h>
21
#include <string>
22
#include <vector>
23
#include "
flute_types.h
"
24
25
namespace
LibFlute
{
29
class
FileDeliveryTable
{
30
public
:
37
FileDeliveryTable
(uint32_t
instance_id
,
FecOti
fec_oti);
38
46
FileDeliveryTable
(uint32_t
instance_id
,
char
* buffer,
size_t
len);
47
51
virtual
~FileDeliveryTable
() {};
52
56
uint32_t
instance_id
() {
return
_instance_id; };
57
61
struct
FileEntry
{
62
uint32_t
toi
;
63
std::string
content_location
;
64
uint32_t
content_length
;
65
std::string
content_md5
;
66
std::string
content_type
;
67
uint64_t
expires
;
68
FecOti
fec_oti
;
69
};
70
74
void
set_expires
(uint64_t exp) { _expires = exp; };
75
79
void
add
(
const
FileEntry& entry);
80
84
void
remove
(uint32_t toi);
85
89
std::string
to_string
()
const
;
90
94
std::vector<FileEntry>
file_entries
() {
return
_file_entries; };
95
96
private
:
97
uint32_t _instance_id;
98
99
std::vector<FileEntry> _file_entries;
100
FecOti
_global_fec_oti;
101
102
uint64_t _expires;
103
};
104
};
LibFlute::FileDeliveryTable
A class for parsing and creating FLUTE FDTs (File Delivery Tables).
Definition:
FileDeliveryTable.h:29
LibFlute::FileDeliveryTable::~FileDeliveryTable
virtual ~FileDeliveryTable()
Default destructor.
Definition:
FileDeliveryTable.h:51
LibFlute::FileDeliveryTable::file_entries
std::vector< FileEntry > file_entries()
Get all current file entries.
Definition:
FileDeliveryTable.h:94
LibFlute::FileDeliveryTable::instance_id
uint32_t instance_id()
Get the FDT instance ID.
Definition:
FileDeliveryTable.h:56
LibFlute::FileDeliveryTable::remove
void remove(uint32_t toi)
Remove a file entry.
Definition:
FileDeliveryTable.cpp:148
LibFlute::FileDeliveryTable::to_string
std::string to_string() const
Serialize the FDT to an XML string.
Definition:
FileDeliveryTable.cpp:160
LibFlute::FileDeliveryTable::FileDeliveryTable
FileDeliveryTable(uint32_t instance_id, FecOti fec_oti)
Create an empty FDT.
Definition:
FileDeliveryTable.cpp:25
LibFlute::FileDeliveryTable::add
void add(const FileEntry &entry)
Add a file entry.
Definition:
FileDeliveryTable.cpp:142
LibFlute::FileDeliveryTable::set_expires
void set_expires(uint64_t exp)
Set the expiry value.
Definition:
FileDeliveryTable.h:74
flute_types.h
LibFlute
Definition:
IpSec.cpp:33
LibFlute::FecOti
OTI values struct.
Definition:
flute_types.h:53
LibFlute::FileDeliveryTable::FileEntry
An entry for a file in the FDT.
Definition:
FileDeliveryTable.h:61
LibFlute::FileDeliveryTable::FileEntry::expires
uint64_t expires
Definition:
FileDeliveryTable.h:67
LibFlute::FileDeliveryTable::FileEntry::content_location
std::string content_location
Definition:
FileDeliveryTable.h:63
LibFlute::FileDeliveryTable::FileEntry::content_md5
std::string content_md5
Definition:
FileDeliveryTable.h:65
LibFlute::FileDeliveryTable::FileEntry::toi
uint32_t toi
Definition:
FileDeliveryTable.h:62
LibFlute::FileDeliveryTable::FileEntry::content_length
uint32_t content_length
Definition:
FileDeliveryTable.h:64
LibFlute::FileDeliveryTable::FileEntry::fec_oti
FecOti fec_oti
Definition:
FileDeliveryTable.h:68
LibFlute::FileDeliveryTable::FileEntry::content_type
std::string content_type
Definition:
FileDeliveryTable.h:66
Generated by
1.9.1