Bitstream Interpretation Library (BIL)  0.1
V5BitstreamSyntaxChecker.cpp
Go to the documentation of this file.
1 
8 
9 using namespace bil;
10 
11 
13 {
14  reset();
15 }
16 
17 
19 {
20  return m_behindSyncWord;
21 }
22 
23 
25 {
26  return m_lastPacketWasType1;
27 }
28 
29 
31 {
32  return m_lastType1Address;
33 }
34 
35 
37 {
38  // reset status flags
39  m_behindSyncWord = false;
40  m_lastPacketWasType1 = false;
41  m_lastType1Address = 0;
42 }
43 
44 
46 {
47  // buswidth pattern is only allowed somewhere in front of sync word
48  if (m_behindSyncWord) throw Exception();
49  m_lastPacketWasType1 = false;
50 }
51 
52 
54 {
55  // dummy words are allowed everywhere
56  m_lastPacketWasType1 = false;
57 }
58 
59 
61 {
62  // sync word is only allowed one time
63  if (m_behindSyncWord) throw Exception();
64  m_behindSyncWord = true;
65  m_lastPacketWasType1 = false;
66 }
67 
68 
70 {
71  // type 1 data packets are only allowed somewhere behind sync word
72  if (!m_behindSyncWord) throw Exception();
73  m_lastPacketWasType1 = true;
74  // store packet's register address
75  m_lastType1Address = type1Packet.registerAddress();
76 }
77 
78 
80 {
81  // type 2 data packets are only allowed somewhere behind sync word and
82  // have to be immediately behind a type 1 packet
83  if (!m_behindSyncWord) throw Exception();
84  if (!m_lastPacketWasType1) throw Exception();
85  m_lastPacketWasType1 = false;
86 }