Kea 2.7.5
server_collection.cc
Go to the documentation of this file.
1// Copyright (C) 2019-2020 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#include <config.h>
8
10
11using namespace isc::data;
12
13namespace isc {
14namespace db {
15
18 const ServerTag& server_tag) {
19 auto& index = collection.get<ServerTagIndexTag>();
20 auto s = index.find(server_tag.get());
21 if (s != index.end()) {
22 return (*s);
23 }
24 return (ServerPtr());
25}
26
27} // end of namespace isc::db
28} // end of namespace isc
Represents a server tag.
Definition server_tag.h:25
static ServerPtr get(const ServerCollection &collection, const data::ServerTag &server_tag)
Fetches server from the collection by tag.
boost::shared_ptr< Server > ServerPtr
Shared pointer to the Server class.
Definition server.h:22
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.
Defines the logger used by the top-level component of kea-lfc.
Tag identifying an index by server tag.