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 <vector>
9 using namespace std;
10 
11 // Qt
12 #include "qmap.h"
13 
15 {
16 public:
17  typedef vector<uint8_t> sections_t;
18  static void InitSections(sections_t &sect, uint32_t last_section);
19 
20  TableStatus() : m_version(-2) {}
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;
29 
30 private:
31  static const uint8_t init_bits[8];
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 
vector< uint8_t > sections_t
Definition: tablestatus.h:17
int32_t m_version
Definition: tablestatus.h:27
sections_t m_sections
Definition: tablestatus.h:28