Kea  2.1.7-git
base_stamped_element.h
Go to the documentation of this file.
1 // Copyright (C) 2019,2021 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 BASE_STAMPED_ELEMENT_H
8 #define BASE_STAMPED_ELEMENT_H
9 
10 #include <cc/data.h>
11 #include <boost/date_time/posix_time/posix_time.hpp>
12 #include <cstdint>
13 
14 namespace isc {
15 namespace data {
16 
31 public:
32 
37 
41  void setId(const uint64_t id) {
42  id_ = id;
43  }
44 
46  uint64_t getId() const {
47  return (id_);
48  }
49 
53  void setModificationTime(const boost::posix_time::ptime& timestamp) {
54  timestamp_ = timestamp;
55  }
56 
59 
61  boost::posix_time::ptime getModificationTime() const {
62  return (timestamp_);
63  }
64 
65 protected:
66 
71  uint64_t id_;
72 
74  boost::posix_time::ptime timestamp_;
75 };
76 
77 } // end of namespace isc::data
78 } // end of namespace isc
79 
80 #endif
boost::posix_time::ptime timestamp_
Holds timestamp value.
uint64_t id_
Database identifier of the configuration element.
void updateModificationTime()
Sets timestamp to the current time.
boost::posix_time::ptime getModificationTime() const
Returns timestamp.
void setModificationTime(const boost::posix_time::ptime &timestamp)
Sets timestamp to the explicitly provided value.
uint64_t getId() const
Returns element&#39;s database identifier.
Defines the logger used by the top-level component of kea-lfc.
void setId(const uint64_t id)
Sets element&#39;s database identifier.
This class represents configuration element which is associated with database identifier and the modi...