MCPcopy Create free account
hub / github.com/davisking/dlib / operator<

Method operator<

dlib/bsp/bsp.h:257–274  ·  view source on GitHub ↗

Make it so that when msg_wrap objects are in a std::priority_queue, messages with a smaller epoch number always come first. Then, within an epoch, messages are ordered by their sequence number (so smaller first there as well).

Source from the content-addressed store, hash-verified

255 // epoch, messages are ordered by their sequence number (so smaller first
256 // there as well).
257 bool operator<(const msg_wrap& item) const
258 {
259 if (data.epoch < item.data.epoch)
260 {
261 return false;
262 }
263 else if (data.epoch > item.data.epoch)
264 {
265 return true;
266 }
267 else
268 {
269 if (sequence_number < item.sequence_number)
270 return false;
271 else
272 return true;
273 }
274 }
275 };
276
277 public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected