本文整理汇总了C++中AisBitset类的典型用法代码示例。如果您正苦于以下问题:C++ AisBitset类的具体用法?C++ AisBitset怎么用?C++ AisBitset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AisBitset类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Ais6
// IFM 4: Capability reply - OLD ITU 1371-4
// TODO(schwehr): WTF? 10 + 128 + 6 == 80 Is this 168 or 232 bits?
Ais6_1_4::Ais6_1_4(const char *nmea_payload, const size_t pad)
: Ais6(nmea_payload, pad), ack_dac(0), capabilities(),
cap_reserved(), spare2(0) {
assert(dac == 1);
assert(fi == 4);
// TODO(schwehr): num_bits for 6_1_4. 226 bits?
if (num_bits != 232) {
status = AIS_ERR_BAD_BIT_COUNT;
return;
}
AisBitset bs;
const AIS_STATUS r = bs.ParseNmeaPayload(nmea_payload, pad);
if (r != AIS_OK) {
status = r;
return;
}
bs.SeekTo(88);
ack_dac = bs.ToUnsignedInt(88, 10);
for (size_t cap_num = 0; cap_num < 128/2; cap_num++) {
size_t start = 98 + cap_num * 2;
capabilities[cap_num] = bs[start];
cap_reserved[cap_num] = bs[start + 1];
}
// spare2 = bs.ToUnsignedInt(226, 6); // OR NOT
// TODO(schwehr): add in the offset of the dest mmsi
assert(bs.GetRemaining() == 0);
status = AIS_OK;
}