![]() |
Kea
1.5.0
|
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 ×tamp) |
| 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... | |
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.
| isc::data::StampedValue::StampedValue | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Constructor.
Creates stamped value from a string.
| name | Name of the value. |
| value | Value to be set. |
Definition at line 14 of file stamped_value.cc.
Referenced by create().
|
explicit |
Constructor.
Creates stamped value from the signed integer.
| name | Name of the value. |
| value | Value to be set. |
Definition at line 19 of file stamped_value.cc.
References isc_throw.
|
static |
Convenience function creating shared pointer to the object.
| name | Name of the value. |
| value | String 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:
|
static |
Convenience function creating shared Pointer to the object.
| name | Name of the value. |
| value | Integer 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:
|
inline |
Returns value name.
Definition at line 71 of file stamped_value.h.
| int64_t isc::data::StampedValue::getSignedIntegerValue | ( | ) | const |
Returns value as signed integer.
| BadValue | if the value can't be converted to an integer. |
Definition at line 45 of file stamped_value.cc.
References isc_throw.
|
inline |
Returns value as string.
Definition at line 76 of file stamped_value.h.