7 #ifndef LABELED_VALUE_H
8 #define LABELED_VALUE_H
12 #include <boost/shared_ptr.hpp>
135 void add(LabeledValuePtr entry);
144 void add(
const int value,
const std::string& label);
152 const LabeledValuePtr&
get(
int value);
167 std::string
getLabel(
const int value)
const;
171 LabeledValueMap map_;
virtual ~LabeledValueSet()
Destructor.
int getValue() const
Gets the integer value of this instance.
LabeledValueSet()
Constructor.
bool operator==(const LabeledValue &other) const
Equality operator.
std::ostream & operator<<(std::ostream &os, const CSVRow &row)
Overrides standard output stream operator for CSVRow object.
std::map< unsigned int, LabeledValuePtr > LabeledValueMap
Defines a map of pointers to LabeledValues keyed by value.
Thrown if an error is encountered handling a LabeledValue.
boost::shared_ptr< LabeledValue > LabeledValuePtr
Defines a shared pointer to a LabeledValue instance.
LabeledValueError(const char *file, size_t line, const char *what)
Implements the concept of a constant value with a text label.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
std::string getLabel() const
Gets the text label of this instance.
virtual ~LabeledValue()
Destructor.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Implements a set of unique LabeledValues.
std::string getLabel(const int value) const
Fetches the label for the given value.
LabeledValue(const int value, const std::string &label)
Constructor.
bool operator<(const LabeledValue &other) const
Less-than operator.
bool isDefined(const int value) const
Tests if the set contains an entry for the given value.
bool operator!=(const LabeledValue &other) const
Inequality operator.
static const char * UNDEFINED_LABEL
Defines a text label returned by when value is not found.
void add(LabeledValuePtr entry)
Adds the given entry to the set.