37 std::shared_ptr<const Packet> packet,
int priority,
38 unsigned long long ticket_number)
39 : packet_(
std::move(packet)), priority_(priority),
40 ticket_number_(ticket_number)
42 if (packet_ ==
nullptr)
44 throw std::invalid_argument(
"Given packet pointer is null.");
73 return (lhs.priority_ == rhs.priority_) &&
74 (lhs.ticket_number_ == rhs.ticket_number_);
92 return (lhs.priority_ != rhs.priority_) ||
93 (lhs.ticket_number_ != rhs.ticket_number_);
118 return (lhs.priority_ < rhs.priority_) || (lhs.priority_ == rhs.priority_ &&
119 (rhs.ticket_number_ - lhs.ticket_number_ >
120 std::numeric_limits<unsigned long long>::max() / 2));
145 return (lhs.priority_ > rhs.priority_) || (lhs.priority_ == rhs.priority_ &&
146 (lhs.ticket_number_ - rhs.ticket_number_ >
147 std::numeric_limits<unsigned long long>::max() / 2));
161 return lhs == rhs || lhs < rhs;
175 return lhs == rhs || lhs > rhs;
194 os << *queued_packet.packet_;
195 os <<
" with priority " << queued_packet.priority_;
QueuedPacket(const QueuedPacket &other)=default
std::ostream & operator<<(std::ostream &os, const Action &action)
bool operator==(const Action &lhs, const Action &rhs)
bool operator<=(const IPAddress &lhs, const IPAddress &rhs)
bool operator!=(const Action &lhs, const Action &rhs)
bool operator>=(const IPAddress &lhs, const IPAddress &rhs)
bool operator>(const IPAddress &lhs, const IPAddress &rhs)
bool operator<(const IPAddress &lhs, const IPAddress &rhs)
std::shared_ptr< const Packet > packet() const