Kea 2.5.7
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
21
26typedef boost::multi_index_container<
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
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
Represents a server tag.
Definition: server_tag.h:25
Utility class used to fetch Server objects from the ServerCollection.
static ServerPtr get(const ServerCollection &collection, const data::ServerTag &server_tag)
Fetches server from the collection by tag.
Represents information about a Kea server in the database.
Definition: server.h:32
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: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.