MythTV  master
tablestatus.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 // Copyright (c) 2003-2012
3 #ifndef TABLESTATUS_H_
4 #define TABLESTATUS_H_
5 
6 // C++
7 #include <cstdint> // uint64_t
8 #include <array>
9 #include <vector>
10 
11 // Qt
12 #include "qmap.h"
13 
15 {
16 public:
17  using sections_t = std::vector<uint8_t>;
18  static void InitSections(sections_t &sect, uint32_t last_section);
19 
20  TableStatus() = default;
21  void SetVersion(int32_t version, uint32_t last_section);
22  void SetSectionSeen(int32_t version, uint32_t section,
23  uint32_t last_section, uint32_t segment_last_section = 0xffff);
24  bool IsSectionSeen(int32_t version, uint32_t section) const;
25  bool HasAllSections() const;
26 
27  int32_t m_version {-2};
29 
30 private:
31  static const std::array<const uint8_t,8> kInitBits;
32 };
33 
34 
35 class TableStatusMap : public QMap<uint32_t, TableStatus>
36 {
37 public:
38  void SetVersion(uint32_t key, int32_t version, uint32_t last_section);
39  void SetSectionSeen(uint32_t key, int32_t version, uint32_t section,
40  uint32_t last_section, uint32_t segment_last_section = 0xffff);
41  bool IsSectionSeen(uint32_t key, int32_t version, uint32_t section) const;
42  bool HasAllSections(uint32_t key) const;
43 };
44 
45 #endif // TABLESTATUS_H_
46 
TableStatus::InitSections
static void InitSections(sections_t &sect, uint32_t last_section)
Definition: tablestatus.cpp:10
TableStatus::HasAllSections
bool HasAllSections() const
Definition: tablestatus.cpp:49
TableStatusMap::SetSectionSeen
void SetSectionSeen(uint32_t key, int32_t version, uint32_t section, uint32_t last_section, uint32_t segment_last_section=0xffff)
Definition: tablestatus.cpp:65
TableStatusMap::HasAllSections
bool HasAllSections(uint32_t key) const
Definition: tablestatus.cpp:81
TableStatusMap::SetVersion
void SetVersion(uint32_t key, int32_t version, uint32_t last_section)
Definition: tablestatus.cpp:58
TableStatus::TableStatus
TableStatus()=default
TableStatus::sections_t
std::vector< uint8_t > sections_t
Definition: tablestatus.h:17
TableStatus::IsSectionSeen
bool IsSectionSeen(int32_t version, uint32_t section) const
Definition: tablestatus.cpp:41
TableStatusMap
Definition: tablestatus.h:36
TableStatus::m_version
int32_t m_version
Definition: tablestatus.h:27
TableStatus
Definition: tablestatus.h:15
TableStatus::kInitBits
static const std::array< const uint8_t, 8 > kInitBits
Definition: tablestatus.h:31
TableStatus::SetVersion
void SetVersion(int32_t version, uint32_t last_section)
Definition: tablestatus.cpp:21
TableStatus::m_sections
sections_t m_sections
Definition: tablestatus.h:28
TableStatusMap::IsSectionSeen
bool IsSectionSeen(uint32_t key, int32_t version, uint32_t section) const
Definition: tablestatus.cpp:73
nv_python_libs.bbciplayer.bbciplayer_api.version
string version
Definition: bbciplayer_api.py:81
TableStatus::SetSectionSeen
void SetSectionSeen(int32_t version, uint32_t section, uint32_t last_section, uint32_t segment_last_section=0xffff)
Definition: tablestatus.cpp:30