176 return (default_.empty());
192 operator<<(std::ostream& os, const Optional<T>& optional_value) {
193 os << optional_value.
get();
201 #endif // OPTIONAL_VALUE_H void unspecified(bool unspecified)
Modifies the flag that indicates whether the value is specified or unspecified.
bool unspecified() const
Checks if the value has been specified or unspecified.
T ValueType
Type of the encapsulated value.
T get() const
Retrieves the encapsulated value.
T default_
Encapsulated value.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Optional()
Default constructor.
bool operator==(const T &other) const
Equality operator.
bool unspecified_
Flag which indicates if the value is specified.
Defines the logger used by the top-level component of kea-lfc.
T valueOr(T const &or_value) const
Retrieves the encapsulated value if specified, or the given value otherwise.
Optional< T > & operator=(A other)
Assigns a new value value and marks it "specified".
A generic exception that is thrown if a function is called in a prohibited way.
bool empty() const
Checks if the encapsulated value is empty.
A template representing an optional value.
Optional(A value, const bool unspecified=false)
Constructor.
bool operator!=(const T &other) const
Inequality operator.