Kea 1.5.0
stamped_value.h
Go to the documentation of this file.
1// Copyright (C) 2018 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_VALUE_H
8#define STAMPED_VALUE_H
9
10#include <cc/stamped_element.h>
11#include <boost/shared_ptr.hpp>
12#include <cstdint>
13#include <string>
14
15namespace isc {
16namespace data {
17
18class StampedValue;
19
21typedef boost::shared_ptr<StampedValue> StampedValuePtr;
22
24typedef std::vector<StampedValuePtr> StampedValueCollection;
25
38public:
39
46 StampedValue(const std::string& name, const std::string& value);
47
54 explicit StampedValue(const std::string& name, const int64_t value);
55
60 static StampedValuePtr create(const std::string& name,
61 const std::string& value);
62
67 static StampedValuePtr create(const std::string& name,
68 const int64_t value);
69
71 std::string getName() const {
72 return (name_);
73 }
74
76 std::string getValue() const {
77 return (value_);
78 }
79
83 int64_t getSignedIntegerValue() const;
84
85private:
86
88 std::string name_;
89
91 std::string value_;
92};
93
95typedef boost::shared_ptr<StampedValue> StampedValuePtr;
96
97} // end of namespace isc::data
98} // end of namespace isc
99
100#endif
This class represents configuration element which is associated with the modification timestamp.
This class represents string or signed integer configuration element associated with the modification...
Definition: stamped_value.h:37
std::string getValue() const
Returns value as string.
Definition: stamped_value.h:76
int64_t getSignedIntegerValue() const
Returns value as signed integer.
std::string getName() const
Returns value name.
Definition: stamped_value.h:71
static StampedValuePtr create(const std::string &name, const std::string &value)
Convenience function creating shared pointer to the object.
boost::shared_ptr< StampedValue > StampedValuePtr
Pointer to the stamped value.
Definition: stamped_value.h:21
std::vector< StampedValuePtr > StampedValueCollection
Collection of pointers to values.
Definition: stamped_value.h:24
Defines the logger used by the top-level component of kea-dhcp-ddns.