21 #ifndef INCLUDE_OLA_SLP_URLENTRY_H_
22 #define INCLUDE_OLA_SLP_URLENTRY_H_
24 #include <ola/io/BigEndianStream.h>
51 m_lifetime(lifetime) {
56 string url()
const {
return m_url; }
57 uint16_t lifetime()
const {
return m_lifetime; }
58 void set_lifetime(uint16_t lifetime) { m_lifetime = lifetime; }
64 bool AgeLifetime(uint16_t seconds) {
65 if (m_lifetime <= seconds) {
74 unsigned int PackedSize()
const {
return 6 + m_url.size(); }
80 bool operator==(
const URLEntry &other)
const {
81 return m_url == other.m_url;
84 bool operator!=(
const URLEntry &other)
const {
85 return m_url != other.m_url;
88 URLEntry& operator=(
const URLEntry &other) {
91 m_lifetime = other.m_lifetime;
96 void ToStream(ostream *out)
const {
97 *out << m_url <<
"(" << m_lifetime <<
")";
100 string ToString()
const {
101 std::ostringstream str;
106 friend ostream& operator<<(ostream &out,
const URLEntry &entry) {
107 entry.ToStream(&out);
118 typedef std::vector<URLEntry> URLEntries;
121 #endif // INCLUDE_OLA_SLP_URLENTRY_H_