Fennel: LbmByteSegment Class Reference (original) (raw)
This class encapsulates a single byte segment, as opposed to a tuple which contains a set of them. More...
#include <[LbmByteSegment.h](LbmByteSegment%5F8h-source.html)>
| Public Member Functions | |
|---|---|
| void | reset () |
| LcsRid | getSrid () const |
| Returns the Srid of the starting byte (not the first rid set). | |
| bool | isNull () const |
| Whether the segment has valid data. | |
| LbmByteNumber | getEnd () const |
| Returns the end byte number. | |
| LcsRid | getEndRid () const |
| Returns the end rid (one past last valid rid). | |
| void | advanceToByteNum (LbmByteNumber newStartByteNum) |
| Ensures the segment begins with the requested byte number. | |
| uint | countBits () |
| Count the number of bits in the current byte segment. | |
| void | print (std::ostream &output) |
| Prints a byte segment. | |
| Static Public Member Functions | |
| static uint | countBits (TupleDatum const &datum) |
| Counts the number of rows represented by a bitmap datum. | |
| static uint | countBits (PConstBuffer pBuf, uint len) |
| Counts the number of bits in an array. | |
| static void | verifyBitsInByte () |
| Public Attributes | |
| LbmByteNumber | byteNum |
| PBuffer | byteSeg |
| uint | len |
| Static Public Attributes | |
| static const uint | bitsInByte [] |
| This array quickly dertermines how many bits are set in a byte. |
Detailed Description
This class encapsulates a single byte segment, as opposed to a tuple which contains a set of them.
Definition at line 35 of file LbmByteSegment.h.
Member Function Documentation
| void LbmByteSegment::reset | ( | | ) | [inline] | | -------------------------- | - | | - | ---------- |
| LcsRid LbmByteSegment::getSrid | ( | | ) | const [inline] | | ------------------------------ | - | | - | ---------------- |
| bool LbmByteSegment::isNull | ( | | ) | const [inline] | | --------------------------- | - | | - | ---------------- |
| LbmByteNumber LbmByteSegment::getEnd | ( | | ) | const [inline] | | ------------------------------------ | - | | - | ---------------- |
| LcsRid LbmByteSegment::getEndRid | ( | | ) | const [inline] | | -------------------------------- | - | | - | ---------------- |
| void LbmByteSegment::advanceToByteNum | ( | LbmByteNumber | newStartByteNum | ) | [inline] |
|---|
Ensures the segment begins with the requested byte number.
As a result, the beginning of the segment or even the entire segment may be truncated.
This function assumes bytes are reverse order.
Definition at line 90 of file LbmByteSegment.h.
References opaqueToInt().
Referenced by LbmUnionWorkspace::addSegment().
00091 {
00092
00093 if (isNull()) {
00094 return;
00095 }
00096
00097
00098 if (getEnd() <= newStartByteNum) {
00099 reset();
00100 return;
00101 }
00102
00103
00104 if (byteNum < newStartByteNum) {
00105 uint diff = opaqueToInt(newStartByteNum - byteNum);
00106 byteNum += diff;
00107 byteSeg -= diff;
00108 len -= diff;
00109 }
00110 }
| uint LbmByteSegment::countBits | ( | | ) | [inline] | | ------------------------------------------------------------------------------------------- | - | | - | ---------- |
| static uint LbmByteSegment::countBits | ( | TupleDatum const & | datum | ) | [inline, static] |
|---|
Counts the number of rows represented by a bitmap datum.
An empty datum represents a single row.
Definition at line 124 of file LbmByteSegment.h.
References TupleDatum::cbData, and TupleDatum::pData.
00125 { 00126 if (datum.pData == NULL || datum.cbData == 0) { 00127 return 1; 00128 } 00129 return countBits(datum.pData, datum.cbData); 00130 }
Counts the number of bits in an array.
Definition at line 135 of file LbmByteSegment.h.
00136 { 00137 uint total = 0; 00138 for (uint i = 0; i < len; i++) { 00139 total += bitsInByte[pBuf[i]]; 00140 } 00141 return total; 00142 }
| static void LbmByteSegment::verifyBitsInByte | ( | | ) | [inline, static] | | -------------------------------------------- | - | | - | ------------------ |
| void LbmByteSegment::print | ( | std::ostream & | output | ) | [inline] |
|---|
Prints a byte segment.
This function assumes bytes are in order.
Definition at line 162 of file LbmByteSegment.h.
References opaqueToInt().
00163 { 00164 output << std::dec << opaqueToInt(byteNum) << "."; 00165 output << std::dec << len << " ("; 00166 for (uint i = 0; i < len; i++) { 00167 uint val = byteSeg[i]; 00168 if (i > 0) { 00169 output << ","; 00170 } 00171 output << std::hex << val; 00172 } 00173 output << ")" << std::endl; 00174 }
Member Data Documentation
This array quickly dertermines how many bits are set in a byte.
Definition at line 38 of file LbmByteSegment.h.
The documentation for this class was generated from the following files:
- /home/pub/open/dev/fennel/lucidera/bitmap/LbmByteSegment.h
- /home/pub/open/dev/fennel/lucidera/bitmap/LbmByteSegment.cpp
