Kea  2.1.7-git
isc::data::BaseStampedElement Class Reference

This class represents configuration element which is associated with database identifier and the modification timestamp. More...

#include <base_stamped_element.h>

+ Inheritance diagram for isc::data::BaseStampedElement:

Public Member Functions

 BaseStampedElement ()
 Constructor. More...
 
uint64_t getId () const
 Returns element's database identifier. More...
 
boost::posix_time::ptime getModificationTime () const
 Returns timestamp. More...
 
void setId (const uint64_t id)
 Sets element's database identifier. More...
 
void setModificationTime (const boost::posix_time::ptime &timestamp)
 Sets timestamp to the explicitly provided value. More...
 
void updateModificationTime ()
 Sets timestamp to the current time. More...
 

Protected Attributes

uint64_t id_
 Database identifier of the configuration element. More...
 
boost::posix_time::ptime timestamp_
 Holds timestamp value. More...
 

Detailed Description

This class represents configuration element which is associated with database identifier and the modification timestamp.

The StampedElement class derives from this class to extend it with the capability to associate the configuration elements with server tags. The db::Server class derives from it to store a single server tag identifying a server it describes.

Note
This class is not derived from Element and should not be confused with the classes being derived from Element class. Those classes are used to represent JSON structures, whereas this class represents data fetched from the database.

Definition at line 30 of file base_stamped_element.h.

Constructor & Destructor Documentation

◆ BaseStampedElement()

isc::data::BaseStampedElement::BaseStampedElement ( )

Constructor.

Sets timestamp to the current time.

Todo:
Change it to microsec_clock once we transition to subsecond precision.

Definition at line 14 of file base_stamped_element.cc.

Member Function Documentation

◆ getId()

uint64_t isc::data::BaseStampedElement::getId ( ) const
inline

Returns element's database identifier.

Definition at line 46 of file base_stamped_element.h.

References id_.

Referenced by isc::dhcp::OptionDefinition::factoryIntegerArray(), isc::dhcp::SharedNetwork4::getAllSubnets(), and isc::dhcp::OptionDescriptor::operator!=().

◆ getModificationTime()

boost::posix_time::ptime isc::data::BaseStampedElement::getModificationTime ( ) const
inline

◆ setId()

void isc::data::BaseStampedElement::setId ( const uint64_t  id)
inline

Sets element's database identifier.

Parameters
idNew id.

Definition at line 41 of file base_stamped_element.h.

References id_.

Referenced by isc::dhcp::CfgOption::add().

◆ setModificationTime()

void isc::data::BaseStampedElement::setModificationTime ( const boost::posix_time::ptime &  timestamp)
inline

Sets timestamp to the explicitly provided value.

Parameters
timestampNew timestamp value.

Definition at line 53 of file base_stamped_element.h.

References timestamp_, and updateModificationTime().

Referenced by updateModificationTime().

+ Here is the call graph for this function:

◆ updateModificationTime()

void isc::data::BaseStampedElement::updateModificationTime ( )

Sets timestamp to the current time.

Todo:
Change it to microsec_clock once we transition to subsecond precision.

Definition at line 21 of file base_stamped_element.cc.

References setModificationTime().

Referenced by setModificationTime().

+ Here is the call graph for this function:

Member Data Documentation

◆ id_

uint64_t isc::data::BaseStampedElement::id_
protected

Database identifier of the configuration element.

The default value of 0 indicates that the identifier is not set.

Definition at line 71 of file base_stamped_element.h.

Referenced by getId(), and setId().

◆ timestamp_

boost::posix_time::ptime isc::data::BaseStampedElement::timestamp_
protected

Holds timestamp value.

Definition at line 74 of file base_stamped_element.h.

Referenced by getModificationTime(), and setModificationTime().


The documentation for this class was generated from the following files: