Kea  1.9.9-git
server_collection.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 DB_SERVER_COLLECTION_H
8 #define DB_SERVER_COLLECTION_H
9 
10 #include <database/server.h>
11 #include <boost/multi_index/mem_fun.hpp>
12 #include <boost/multi_index/indexed_by.hpp>
13 #include <boost/multi_index/ordered_index.hpp>
14 #include <boost/multi_index_container.hpp>
15 
16 namespace isc {
17 namespace db {
18 
20 struct ServerTagIndexTag { };
21 
26 typedef boost::multi_index_container<
27  ServerPtr,
28  boost::multi_index::indexed_by<
29  boost::multi_index::ordered_unique<
30  boost::multi_index::tag<ServerTagIndexTag>,
31  boost::multi_index::const_mem_fun<Server, std::string,
33  >
34  >
36 
40 public:
41 
46  static ServerPtr get(const ServerCollection& collection,
47  const data::ServerTag& server_tag);
48 };
49 
50 } // end of namespace isc::db
51 } // end of namespace isc
52 
53 #endif
std::string getServerTagAsText() const
Returns server tag as text.
Definition: server.h:61
boost::shared_ptr< Server > ServerPtr
Shared pointer to the Server class.
Definition: server.h:19
boost::multi_index_container< ServerPtr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< ServerTagIndexTag >, boost::multi_index::const_mem_fun< Server, std::string,&Server::getServerTagAsText > > >> ServerCollection
Multi index container for Server.
Represents a server tag.
Definition: server_tag.h:25
Defines the logger used by the top-level component of kea-dhcp-ddns.
Tag identifying an index by server tag.
Utility class used to fetch Server objects from the ServerCollection.
Represents information about a Kea server in the database.
Definition: server.h:32