MythTV  master
dsmccobjcarousel.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) David C.J. Matthews 2005, 2006
3  * Derived from libdsmcc by Richard Palmer
4  */
5 #ifndef DSMCC_OBJCAROUSEL_H
6 #define DSMCC_OBJCAROUSEL_H
7 
8 #include <list>
9 #include <vector>
10 using namespace std;
11 
12 class DsmccDii;
13 class Dsmcc;
14 class DsmccDb;
15 class DsmccModuleInfo;
16 
17 #include "dsmcccache.h"
18 #include "dsmccbiop.h" // For ModuleDescriptorData
19 
25 {
26  public:
28  unsigned short streamTag);
30 
31  unsigned char *AddModuleData(DsmccDb *ddb, const unsigned char *Data);
32 
33  unsigned long CarouselId(void) const { return m_carouselId; }
34  unsigned short ModuleId(void) const { return m_moduleId; }
35  unsigned short StreamId(void) const { return m_streamId; }
36  unsigned char Version(void) const { return m_version; }
37  unsigned long ModuleSize(void) const { return m_moduleSize; }
38 
40  unsigned long DataSize(void) const
41  {
42  return (m_descriptorData.m_isCompressed) ?
43  m_descriptorData.m_originalSize : m_moduleSize;
44  }
45 
46 
47  private:
48  unsigned long m_carouselId;
49  unsigned short m_moduleId;
50  unsigned short m_streamId;
51 
52  unsigned char m_version;
53  unsigned long m_moduleSize;
54  unsigned long m_receivedData {0};
55 
57  vector<QByteArray*> m_blocks;
59  bool m_completed {false};
61 };
62 
64 {
65  public:
66  explicit ObjCarousel(Dsmcc*dsmcc) : m_fileCache(dsmcc) {}
67  ~ObjCarousel();
68  void AddModuleInfo(DsmccDii *dii, Dsmcc *status, unsigned short streamTag);
69  void AddModuleData(DsmccDb *ddb, const unsigned char *data);
70 
72  std::list<DSMCCCacheModuleData*> m_Cache;
74  vector<unsigned short> m_Tags;
75  unsigned long m_id {0};
76 };
77 
78 #endif
79 
DSMCCCacheModuleData::CarouselId
unsigned long CarouselId(void) const
Definition: dsmccobjcarousel.h:33
DsmccDb
Definition: dsmccreceiver.h:56
dsmcccache.h
DSMCCCacheModuleData
DSMCCCacheModuleData contains information about a module and holds the blocks for a partly completed ...
Definition: dsmccobjcarousel.h:25
DSMCCCacheModuleData::m_blocks
vector< QByteArray * > m_blocks
Block table. As blocks are received they are added to this table.
Definition: dsmccobjcarousel.h:57
DSMCCCacheModuleData::m_moduleSize
unsigned long m_moduleSize
Total size.
Definition: dsmccobjcarousel.h:53
DSMCCCache
Definition: dsmcccache.h:87
DsmccDii
Definition: dsmccreceiver.h:11
DSMCCCacheModuleData::DataSize
unsigned long DataSize(void) const
Return the, possibly uncompressed, module size.
Definition: dsmccobjcarousel.h:40
DSMCCCacheModuleData::m_streamId
unsigned short m_streamId
Definition: dsmccobjcarousel.h:50
ObjCarousel
Definition: dsmccobjcarousel.h:64
dsmccbiop.h
DsmccModuleInfo
Definition: dsmccbiop.h:228
DSMCCCacheModuleData::ModuleSize
unsigned long ModuleSize(void) const
Definition: dsmccobjcarousel.h:37
ObjCarousel::ObjCarousel
ObjCarousel(Dsmcc *dsmcc)
Definition: dsmccobjcarousel.h:66
DSMCCCacheModuleData::m_version
unsigned char m_version
Definition: dsmccobjcarousel.h:52
DSMCCCacheModuleData::StreamId
unsigned short StreamId(void) const
Definition: dsmccobjcarousel.h:35
Dsmcc
Definition: dsmcc.h:78
ObjCarousel::m_fileCache
DSMCCCache m_fileCache
Definition: dsmccobjcarousel.h:71
ObjCarousel::m_Cache
std::list< DSMCCCacheModuleData * > m_Cache
Definition: dsmccobjcarousel.h:72
DSMCCCacheModuleData::Version
unsigned char Version(void) const
Definition: dsmccobjcarousel.h:36
ObjCarousel::m_Tags
vector< unsigned short > m_Tags
Component tags matched to this carousel.
Definition: dsmccobjcarousel.h:74
DSMCCCacheModuleData::m_moduleId
unsigned short m_moduleId
Definition: dsmccobjcarousel.h:49
DSMCCCacheModuleData::m_carouselId
unsigned long m_carouselId
Definition: dsmccobjcarousel.h:48
DSMCCCacheModuleData::ModuleId
unsigned short ModuleId(void) const
Definition: dsmccobjcarousel.h:34
ModuleDescriptorData
Definition: dsmccbiop.h:203
DSMCCCacheModuleData::m_descriptorData
ModuleDescriptorData m_descriptorData
Definition: dsmccobjcarousel.h:60