![]() |
Kea 3.1.1
|
Collection of attributes. More...
#include <client_attribute.h>
Public Types | |
typedef boost::multi_index_container< ConstAttributePtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< boost::multi_index::member< Attribute, const uint8_t, &Attribute::type_ > > > > | AttributeContainer |
Type of the container. | |
Public Member Functions | |
Attributes () | |
constructor. | |
Attributes (const Attributes &other) | |
Copy constructor. | |
virtual | ~Attributes () |
Destructor. | |
void | add (const ConstAttributePtr &attr) |
Adds instance of the attribute to the collection. | |
void | append (const Attributes &other) |
Append another collection. | |
AttributeContainer::iterator | begin () |
Get the iterator to the beginning. | |
AttributeContainer::const_iterator | begin () const |
Get the iterator to the beginning. | |
AttributeContainer::const_iterator | cbegin () const |
Get the const iterator to the beginning. | |
AttributeContainer::const_iterator | cend () const |
Get the const iterator to the past-the-end. | |
void | clear () |
Clear the collection. | |
size_t | count (const uint8_t type) const |
Counts instance of the attribute in the collection. | |
bool | del (const uint8_t type) |
Deletes an attribute from the collection. | |
bool | empty () const |
Indicates the object is empty. | |
AttributeContainer::iterator | end () |
Get the iterator to the past-the-end. | |
AttributeContainer::const_iterator | end () const |
Get the iterator to the past-the-end. | |
ConstAttributePtr | get (const uint8_t type) const |
Get instance of the attribute in the collection. | |
size_t | size () const |
Returns the number of elements. | |
data::ElementPtr | toElement () const override |
Unparse collection. | |
std::string | toText (size_t indent=0) const |
Returns text representation of the collection. | |
![]() | |
virtual | ~CfgToElement () |
Destructor. | |
Static Public Member Functions | |
static Attributes | fromElement (const data::ConstElementPtr &attr_list) |
Parse collection. | |
Protected Attributes | |
AttributeContainer | container_ |
The container. | |
Collection of attributes.
Definition at line 652 of file client_attribute.h.
typedef boost::multi_index_container< ConstAttributePtr, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_non_unique< boost::multi_index::member< Attribute, const uint8_t, &Attribute::type_ > > > > isc::radius::Attributes::AttributeContainer |
Type of the container.
Definition at line 670 of file client_attribute.h.
|
inline |
constructor.
Definition at line 673 of file client_attribute.h.
References container_.
Referenced by Attributes(), append(), and fromElement().
|
inline |
Copy constructor.
other | source attributes. |
Definition at line 679 of file client_attribute.h.
References Attributes(), and container_.
|
inlinevirtual |
Destructor.
Definition at line 683 of file client_attribute.h.
References clear().
void isc::radius::Attributes::add | ( | const ConstAttributePtr & | attr | ) |
Adds instance of the attribute to the collection.
attr | Pointer to the attribute being added (can be null). |
Definition at line 616 of file client_attribute.cc.
References container_.
Referenced by append(), fromElement(), isc::radius::CfgAttributes::getAll(), and isc::radius::CfgAttributes::getEvalAll().
void isc::radius::Attributes::append | ( | const Attributes & | other | ) |
Append another collection.
other | The other collection to be appended to this one. |
Definition at line 635 of file client_attribute.cc.
References Attributes(), and add().
|
inline |
Get the iterator to the beginning.
Definition at line 756 of file client_attribute.h.
References container_.
|
inline |
Get the iterator to the beginning.
Definition at line 763 of file client_attribute.h.
References container_.
|
inline |
Get the const iterator to the beginning.
Definition at line 770 of file client_attribute.h.
References container_.
|
inline |
Get the const iterator to the past-the-end.
Definition at line 789 of file client_attribute.h.
References container_.
|
inline |
Clear the collection.
Definition at line 715 of file client_attribute.h.
References container_.
Referenced by ~Attributes().
size_t isc::radius::Attributes::count | ( | const uint8_t | type | ) | const |
Counts instance of the attribute in the collection.
type | type of the attribute to count. |
Definition at line 642 of file client_attribute.cc.
References container_.
bool isc::radius::Attributes::del | ( | const uint8_t | type | ) |
Deletes an attribute from the collection.
Delete only the first occurrence.
type | type of the attribute to delete. |
Definition at line 624 of file client_attribute.cc.
References container_.
|
inline |
Indicates the object is empty.
Definition at line 690 of file client_attribute.h.
References container_.
|
inline |
Get the iterator to the past-the-end.
Definition at line 777 of file client_attribute.h.
References container_.
|
inline |
Get the iterator to the past-the-end.
Definition at line 784 of file client_attribute.h.
References container_.
|
static |
Parse collection.
attr_list the attribute list to parse.
Definition at line 683 of file client_attribute.cc.
References Attributes(), add(), isc::util::encode::decodeHex(), isc::radius::Attribute::fromBytes(), isc::radius::Attribute::fromText(), isc::radius::AttrDefs::getByType(), isc::radius::AttrDefs::instance(), Element::integer, Element::list, Element::map, isc::radius::PW_TYPE_STRING, and Element::string.
Referenced by isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct4(), and isc::radius::RadiusAccounting::buildAcct6().
ConstAttributePtr isc::radius::Attributes::get | ( | const uint8_t | type | ) | const |
Get instance of the attribute in the collection.
type | type of the attribute to retrieve. |
Definition at line 648 of file client_attribute.cc.
References container_.
Referenced by isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct4(), and isc::radius::RadiusAccounting::buildAcct6().
|
inline |
Returns the number of elements.
Definition at line 697 of file client_attribute.h.
References container_.
Referenced by isc::radius::RadiusServiceParser::checkAttributes().
|
overridevirtual |
Unparse collection.
Implements isc::data::CfgToElement.
Definition at line 674 of file client_attribute.cc.
References Element::createList().
string isc::radius::Attributes::toText | ( | size_t | indent = 0 | ) | const |
Returns text representation of the collection.
indent | number of spaces before printing text. |
Definition at line 659 of file client_attribute.cc.
|
protected |