diff options
author | Marcin Siodelski <marcin@isc.org> | 2019-06-28 15:58:26 +0200 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2019-06-30 14:35:44 +0200 |
commit | 835aeee9b1b6f6ef0e721a19462cfe52ae5766c9 (patch) | |
tree | 0d7459f2a4708c85d4f7ec4fdf8b95c9a83081bb /src/lib/cc | |
parent | [#651,!384] Updated ChangeLog entry (diff) | |
download | kea-835aeee9b1b6f6ef0e721a19462cfe52ae5766c9.tar.xz kea-835aeee9b1b6f6ef0e721a19462cfe52ae5766c9.zip |
[#676] Modified internal representation of the tags in ServerSelector.
Diffstat (limited to 'src/lib/cc')
-rw-r--r-- | src/lib/cc/server_tag.cc | 6 | ||||
-rw-r--r-- | src/lib/cc/server_tag.h | 18 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/cc/server_tag.cc b/src/lib/cc/server_tag.cc index e99d75bef4..56b20aa31d 100644 --- a/src/lib/cc/server_tag.cc +++ b/src/lib/cc/server_tag.cc @@ -35,5 +35,11 @@ ServerTag::amAll() const { return (tag_ == ALL); } +std::ostream& +operator<<(std::ostream& os, const ServerTag& server_tag) { + os << server_tag.get(); + return (os); +} + } // end of namespace isc::data } // end of namespace isc diff --git a/src/lib/cc/server_tag.h b/src/lib/cc/server_tag.h index c85fc1bd5c..abfa75036c 100644 --- a/src/lib/cc/server_tag.h +++ b/src/lib/cc/server_tag.h @@ -50,12 +50,30 @@ public: return (tag_); } + /// @brief Overload of the less operator for using @c ServerTag in sets. + /// + /// @param other other server tag to compare to. + /// @return true if this server tag is less than the other server tag. + bool operator<(const ServerTag& other) const { + return (tag_ < other.tag_); + } + private: /// @brief Holds server tag as string. std::string tag_; }; +/// @brief Insert the @c ServerTag as a string into stream. +/// +/// @param os stream to insert server tag into. +/// @param server_tag server tag to be converted to text and +/// inserted into a stream. +/// @return Reference to the stream object with inserted server +/// tag. +std::ostream& +operator<<(std::ostream& os, const ServerTag& server_tag); + } // end of namespace isc::data } // end of namespace isc |