Kea  1.5.0
isc::data::StampedValue Class Reference

This class represents string or signed integer configuration element associated with the modification timestamp. More...

#include <stamped_value.h>

+ Inheritance diagram for isc::data::StampedValue:

Public Member Functions

 StampedValue (const std::string &name, const std::string &value)
 Constructor. More...
 
 StampedValue (const std::string &name, const int64_t value)
 Constructor. More...
 
std::string getName () const
 Returns value name. More...
 
int64_t getSignedIntegerValue () const
 Returns value as signed integer. More...
 
std::string getValue () const
 Returns value as string. More...
 
- Public Member Functions inherited from isc::data::StampedElement
 StampedElement ()
 Constructor. More...
 
boost::posix_time::ptime getModificationTime () const
 Returns timestamp. More...
 
void setModificationTime (const boost::posix_time::ptime &timestamp)
 Sets timestamp to the explicitly provided value. More...
 
void updateModificationTime ()
 Sets timestmp to the current time. More...
 

Static Public Member Functions

static StampedValuePtr create (const std::string &name, const std::string &value)
 Convenience function creating shared pointer to the object. More...
 
static StampedValuePtr create (const std::string &name, const int64_t value)
 Convenience function creating shared Pointer to the object. More...
 

Detailed Description

This class represents string or signed integer configuration element associated with the modification timestamp.

Global configuration elements having simple types, e.g. DHCP timers, need to be associatied with modification timestamps. This association is made by deriving from StampedElement. Values can be both integers and strings. Because strings are more flexible, configuration elements are always held as strings in the configuration backends. This class reflects a single value held in the database. The value can be converted to an integer or can be returned as a string.

Definition at line 37 of file stamped_value.h.

Constructor & Destructor Documentation

◆ StampedValue() [1/2]

isc::data::StampedValue::StampedValue ( const std::string &  name,
const std::string &  value 
)

Constructor.

Creates stamped value from a string.

Parameters
nameName of the value.
valueValue to be set.

Definition at line 14 of file stamped_value.cc.

Referenced by create().

◆ StampedValue() [2/2]

isc::data::StampedValue::StampedValue ( const std::string &  name,
const int64_t  value 
)
explicit

Constructor.

Creates stamped value from the signed integer.

Parameters
nameName of the value.
valueValue to be set.

Definition at line 19 of file stamped_value.cc.

References isc_throw.

Member Function Documentation

◆ create() [1/2]

StampedValuePtr isc::data::StampedValue::create ( const std::string &  name,
const std::string &  value 
)
static

Convenience function creating shared pointer to the object.

Parameters
nameName of the value.
valueString value to be encapsulated by this object.

Definition at line 32 of file stamped_value.cc.

References StampedValue().

+ Here is the call graph for this function:

◆ create() [2/2]

StampedValuePtr isc::data::StampedValue::create ( const std::string &  name,
const int64_t  value 
)
static

Convenience function creating shared Pointer to the object.

Parameters
nameName of the value.
valueInteger value to be encapsulated by this object.

Definition at line 38 of file stamped_value.cc.

References StampedValue().

+ Here is the call graph for this function:

◆ getName()

std::string isc::data::StampedValue::getName ( ) const
inline

Returns value name.

Definition at line 71 of file stamped_value.h.

◆ getSignedIntegerValue()

int64_t isc::data::StampedValue::getSignedIntegerValue ( ) const

Returns value as signed integer.

Exceptions
BadValueif the value can't be converted to an integer.

Definition at line 45 of file stamped_value.cc.

References isc_throw.

◆ getValue()

std::string isc::data::StampedValue::getValue ( ) const
inline

Returns value as string.

Definition at line 76 of file stamped_value.h.


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