Bitstream Interpretation Library (BIL)  0.1
CorrelationUnit.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 #ifndef BIL_CORRELATIONUNIT_HPP
8 #define BIL_CORRELATIONUNIT_HPP
9 
10 #include <vector>
11 #include <boost/cstdint.hpp>
12 #include <boost/dynamic_bitset.hpp>
13 
14 
15 namespace bil {
16 
30  public:
31 
32  /**********************************************************************/
33  /* PIP BITSET */
34  /**********************************************************************/
35 
40  void pipBitSize(size_t size);
41 
46  size_t pipBitSize() const;
47 
48 
53  void setPIPBit(size_t index);
54 
59  void resetPIPBit(size_t index);
60 
64  void setPIPBits();
65 
69  void resetPIPBits();
70 
71 
77  bool testPIPBit(size_t index) const;
78 
83  bool isIsolated() const;
84 
85 
86  /**********************************************************************/
87  /* CONFIGURATION DATA BITSET */
88  /**********************************************************************/
89 
94  void cfgBitSize(size_t size);
95 
100  size_t cfgBitSize() const;
101 
102 
107  void setCfgBit(size_t index);
108 
113  void resetCfgBit(size_t index);
114 
118  void setCfgBits();
119 
123  void resetCfgBits();
124 
125 
131  bool testCfgBit(size_t index) const;
132 
134  static const size_t INVALID_BIT_INDEX = static_cast<size_t>(-1);
135 
140  size_t firstCfgBit() const;
141 
147  size_t nextCfgBit(size_t index) const;
148 
149 
155  void appendCfgBits(boost::uint32_t* data, size_t dataWordCount);
156 
157 
158  /**********************************************************************/
159  /* INTERSECTION */
160  /**********************************************************************/
161 
167  void intersect(const CorrelationUnit& with);
168 
174  void intersectInverted(const CorrelationUnit& with);
175 
176 
177  private:
178 
179  boost::dynamic_bitset<boost::uint32_t> m_pipBits;
180  boost::dynamic_bitset<boost::uint32_t> m_cfgBits;
181 
182  };
183 
184 
186  typedef std::vector<CorrelationUnit> CorrelationUnits;
187 
188 }
189 
190 #endif