7 #ifndef OPTIONAL_VALUE_H 8 #define OPTIONAL_VALUE_H 63 : value_(T()), specified_(false) {
75 : value_(value), specified_(state.specified_) {
86 void set(
const T& value) {
127 return (specified_ && (value_ == value));
136 return (!
operator==(value));
168 os << optional_value.
get();
176 #endif // OPTIONAL_VALUE_H void operator=(const T &value)
Specifies a new value value and marks it "specified".
Simple class representing an optional value.
std::ostream & operator<<(std::ostream &os, const CSVRow &row)
Overrides standard output stream operator for CSVRow object.
void specify(const T &value)
Sets the new value and marks it specified.
void specify(const OptionalValueState &state)
Sets the value to "specified" or "unspecified".
Indicate if an OptionalValue is is specified or not.
OptionalValueState(const bool specified)
Constructor.
T get() const
Retrieves the actual value.
Defines the logger used by the top-level component of kea-dhcp-ddns.
bool operator==(const T &value) const
Equality operator.
void set(const T &value)
Sets the actual value.
OptionalValue()
Default constructor.
bool isSpecified() const
Checks if the value is specified or unspecified.
bool operator!=(const T &value) const
Inequality operator.
bool specified_
A bool value encapsulated by this structure.
OptionalValue(const T &value, const OptionalValueState &state=OptionalValueState(false))
Constructor.