Kea  1.9.9-git
server_tag.h
Go to the documentation of this file.
1 // Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef SERVER_TAG_H
8 #define SERVER_TAG_H
9 
10 #include <string>
11 
12 namespace isc {
13 namespace data {
14 
25 class ServerTag {
26 public:
27 
29  static std::string ALL;
30 
34  ServerTag();
35 
40  explicit ServerTag(const std::string& tag);
41 
46  bool amAll() const;
47 
51  std::string get() const {
52  return (tag_);
53  }
54 
59  bool operator<(const ServerTag& other) const {
60  return (tag_ < other.tag_);
61  }
62 
63 private:
64 
66  std::string tag_;
67 };
68 
76 std::ostream&
77 operator<<(std::ostream& os, const ServerTag& server_tag);
78 
79 } // end of namespace isc::data
80 } // end of namespace isc
81 
82 #endif // SERVER_TAG_H
Represents a server tag.
Definition: server_tag.h:25
std::ostream & operator<<(std::ostream &out, const Element::Position &pos)
Insert Element::Position as a string into stream.
Definition: data.cc:45
bool amAll() const
Checks if the server tag is set to "all servers".
Definition: server_tag.cc:42
ServerTag()
Default constructor.
Definition: server_tag.cc:19
Defines the logger used by the top-level component of kea-dhcp-ddns.
bool operator<(const ServerTag &other) const
Overload of the less operator for using ServerTag in sets.
Definition: server_tag.h:59
static std::string ALL
Server tag for all servers as text.
Definition: server_tag.h:29