17#include <boost/shared_ptr.hpp>
69 const std::string&
test);
85 bool del(
const uint8_t type);
96 size_t count(
const uint8_t type)
const {
122 std::string
getTest(
const uint8_t type)
const;
157 const std::string&
test)
162 if (expr || !
test.empty()) {
164 isc_throw(BadValue,
"once of attribute or test");
166 if (!expr ||
test.empty()) {
167 isc_throw(BadValue,
"missing expression or test");
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Base class for classes representing DHCP messages.
Collection of attributes.
AttrDefPtr def_
Pointer to the attribute definition (required).
ConstAttributePtr attr_
Pointer to the attribute.
std::string test_
Original expression.
dhcp::ExpressionPtr expr_
Expression to compute the value.
AttributeValue(const AttrDefPtr &def, const ConstAttributePtr &attr, const dhcp::ExpressionPtr &expr, const std::string &test)
Constructor.
Attributes getAll() const
Get all attributes in the configuration.
CfgAttributes()
Constructor.
void add(const AttrDefPtr &def, const ConstAttributePtr &attr, const dhcp::ExpressionPtr &expr, const std::string &test)
Adds instance of the attribute to the configuration.
AttrDefPtr getDef(const uint8_t type) const
Returns the definition of an attribute.
size_t size() const
Returns the number of elements.
size_t count(const uint8_t type) const
Counts instance of the attribute in the configuration.
bool empty() const
Checks if the object is empty.
void add(const AttrDefPtr &def, const ConstAttributePtr &attr)
Adds instance of the attribute to the configuration.
ConstAttributePtr get(const uint8_t type) const
Get instance of the attribute in the configuration.
std::multimap< uint8_t, AttributeValue > container_
The container.
void clear()
Clear the container.
dhcp::ExpressionPtr getExpr(const uint8_t type) const
Returns the expression of an attribute.
std::string getTest(const uint8_t type) const
Returns the text expression of an attribute.
bool del(const uint8_t type)
Deletes an attribute from the configuration.
Attributes getEvalAll(dhcp::Pkt &pkt)
Get all evaluated attributes in the configuration.
data::ElementPtr toElement() const override
Unparse configuration.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< Expression > ExpressionPtr
boost::shared_ptr< const Attribute > ConstAttributePtr
boost::shared_ptr< AttrDef > AttrDefPtr
Shared pointers to Attribute definition.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.