Kea: stamped_element.h Source File

| Kea 3.0.3-git

stamped_element.h
Go to the documentation of this file.
1// Copyright (C) 2018-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 STAMPED_ELEMENT_H
8#define STAMPED_ELEMENT_H
9
10#include <cc/base_stamped_element.h>
11#include <cc/server_tag.h>
12#include <set>
13
14namespace isc {
15namespace data {
16
34 class StampedElement : public BaseStampedElement {
35public:
36
40 StampedElement();
41
46 void setServerTag(const std::string& server_tag) {
47 server_tags_.insert(ServerTag(server_tag));
48 }
49
56 void delServerTag(const std::string& server_tag);
57
61 std::set<ServerTag> getServerTags() const {
62 return (server_tags_);
63 }
64
69 bool hasServerTag(const ServerTag& server_tag) const;
70
74 bool hasAllServerTag() const;
75
80 isc::data::ElementPtr getMetadata() const;
81
82private:
83
85 std::set<ServerTag> server_tags_;
86};
87
88} // end of namespace isc::data
89} // end of namespace isc
90
91#endif
base_stamped_element.h
isc::data::BaseStampedElement::BaseStampedElement
BaseStampedElement()
Constructor.
Definition base_stamped_element.cc:14
isc::data::ServerTag
Represents a server tag.
Definition server_tag.h:25
isc::data::StampedElement::delServerTag
void delServerTag(const std::string &server_tag)
Deletes server tag.
Definition stamped_element.cc:24
isc::data::StampedElement::getMetadata
isc::data::ElementPtr getMetadata() const
Returns an object representing metadata to be returned with objects from the configuration backend.
Definition stamped_element.cc:37
isc::data::StampedElement::getServerTags
std::set< ServerTag > getServerTags() const
Returns server tags.
Definition stamped_element.h:61
isc::data::StampedElement::hasAllServerTag
bool hasAllServerTag() const
Checks if the element has 'all' server tag.
Definition stamped_element.cc:31
isc::data::StampedElement::hasServerTag
bool hasServerTag(const ServerTag &server_tag) const
Checks if the element has the given server tag.
Definition stamped_element.cc:19
isc::data::StampedElement::setServerTag
void setServerTag(const std::string &server_tag)
Adds new server tag.
Definition stamped_element.h:46
isc::data::StampedElement::StampedElement
StampedElement()
Constructor.
Definition stamped_element.cc:14
isc::data
Definition base_stamped_element.cc:12
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
server_tag.h