35 const unsigned int BundleID::RAW_LENGTH_MAX = 33 + 1024 + 1 + 1024;
38 : source(), timestamp(0), sequencenumber(0), fragmentoffset(0), _fragment(false), _payloadlength(0)
43 : source(id.source), timestamp(id.timestamp), sequencenumber(id.sequencenumber),
44 fragmentoffset(id.fragmentoffset), _fragment(id.isFragment()), _payloadlength(id.getPayloadLength())
88 return !(((*this) < other) || ((*
this) == other));
93 return !((*this) == other);
114 return _payloadlength;
119 _payloadlength = value;
134 unsigned char data[RAW_LENGTH_MAX];
135 const size_t data_len =
raw((
unsigned char*)&data, RAW_LENGTH_MAX);
136 bf.
insert((
unsigned char*)&data, data_len);
141 unsigned char data[RAW_LENGTH_MAX];
142 const size_t data_len =
raw((
unsigned char*)&data, RAW_LENGTH_MAX);
143 return bf.
contains((
unsigned char*)&data, data_len);
151 if (len < 33)
return 0;
155 ::memcpy(data, reinterpret_cast<unsigned char*>(&tmp),
sizeof(tmp));
160 ::memcpy(data, reinterpret_cast<unsigned char*>(&tmp),
sizeof(tmp));
165 data +=
sizeof(uint8_t);
169 ::memcpy(data, reinterpret_cast<unsigned char*>(&tmp),
sizeof(tmp));
174 ::memcpy(data, reinterpret_cast<unsigned char*>(&tmp),
sizeof(tmp));
181 ::strncpy((
char*)data, s.c_str(), len - 33);
183 if ((len - 33) < s.length()) {
186 return 33 + s.length();
232 stream.
get((
char&)frag);