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