Kea: server_collection.h Source File

| Kea 3.0.0

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
16namespace isc {
17namespace db {
18
20 struct ServerTagIndexTag { };
21
26typedef 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,
32 &Server::getServerTagAsText>
33 >
34 >
35> ServerCollection;
36
39 class ServerFetcher {
40public:
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
isc::data::ServerTag
Represents a server tag.
Definition server_tag.h:25
isc::db::ServerFetcher
Utility class used to fetch Server objects from the ServerCollection.
Definition server_collection.h:39
isc::db::ServerFetcher::get
static ServerPtr get(const ServerCollection &collection, const data::ServerTag &server_tag)
Fetches server from the collection by tag.
Definition server_collection.cc:17
isc::db::Server
Represents information about a Kea server in the database.
Definition server.h:32
isc::db::Server::getServerTagAsText
std::string getServerTagAsText() const
Returns server tag as text.
Definition server.h:61
isc::db
Definition audit_entry.cc:14
isc::db::ServerPtr
boost::shared_ptr< Server > ServerPtr
Shared pointer to the Server class.
Definition server.h:22
isc::db::ServerCollection
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.
Definition server_collection.h:35
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
server.h
isc::db::ServerTagIndexTag
Tag identifying an index by server tag.
Definition server_collection.h:20