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 
15 namespace isc {
16 namespace data {
17 
18 class StampedValue;
19 
21 typedef boost::shared_ptr<StampedValue> StampedValuePtr;
22 
24 typedef std::vector<StampedValuePtr> StampedValueCollection;
25 
37 class StampedValue : public StampedElement {
38 public:
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 
85 private:
86 
88  std::string name_;
89 
91  std::string value_;
92 };
93 
95 typedef boost::shared_ptr<StampedValue> StampedValuePtr;
96 
97 } // end of namespace isc::data
98 } // end of namespace isc
99 
100 #endif
stamped_element.h
isc::data::StampedValue
This class represents string or signed integer configuration element associated with the modification...
Definition: stamped_value.h:37
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::data::StampedValue::create
static StampedValuePtr create(const std::string &name, const std::string &value)
Convenience function creating shared pointer to the object.
Definition: stamped_value.cc:32
isc::data::StampedValue::getSignedIntegerValue
int64_t getSignedIntegerValue() const
Returns value as signed integer.
Definition: stamped_value.cc:45
isc::data::StampedElement
This class represents configuration element which is associated with the modification timestamp.
Definition: stamped_element.h:31
isc::data::StampedValue::StampedValue
StampedValue(const std::string &name, const std::string &value)
Constructor.
Definition: stamped_value.cc:14
isc::data::StampedValue::getValue
std::string getValue() const
Returns value as string.
Definition: stamped_value.h:76
isc::data::StampedValueCollection
std::vector< StampedValuePtr > StampedValueCollection
Collection of pointers to values.
Definition: stamped_value.h:24
isc::data::StampedValue::getName
std::string getName() const
Returns value name.
Definition: stamped_value.h:71
isc::data::StampedValuePtr
boost::shared_ptr< StampedValue > StampedValuePtr
Pointer to the stamped value.
Definition: stamped_value.h:18