BDE 4.14.0 Production release
|
#include <ball_managedattributeset.h>
Public Types | |
typedef bsl::allocator< char > | allocator_type |
typedef SetType::const_iterator | const_iterator |
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (ManagedAttributeSet, bslma::UsesBslmaAllocator) | |
ManagedAttributeSet () | |
ManagedAttributeSet (const allocator_type &allocator) | |
ManagedAttributeSet (const ManagedAttributeSet &original, const allocator_type &allocator=allocator_type()) | |
~ManagedAttributeSet ()=default | |
Destroy this attribute set. | |
ManagedAttributeSet & | operator= (const ManagedAttributeSet &rhs) |
bool | addAttribute (const ManagedAttribute &value) |
int | addPredicate (const ManagedAttribute &value) |
void | removeAll () |
Remove all attributes from this attribute set. | |
void | removeAllPredicates () |
bool | removeAttribute (const ManagedAttribute &value) |
int | removePredicate (const ManagedAttribute &value) |
bool | evaluate (const AttributeContainerList &containerList) const |
allocator_type | get_allocator () const |
bool | isMember (const ManagedAttribute &value) const |
int | numAttributes () const |
Return the number of attributes managed by this object. | |
int | numPredicates () const |
const_iterator | begin () const |
const_iterator | end () const |
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
Static Public Member Functions | |
static int | hash (const ManagedAttributeSet &set, int size) |
Friends | |
bool | operator== (const ManagedAttributeSet &, const ManagedAttributeSet &) |
bool | operator!= (const ManagedAttributeSet &, const ManagedAttributeSet &) |
bsl::ostream & | operator<< (bsl::ostream &, const ManagedAttributeSet &) |
This class implements a value-semantic collection of unique attributes. (Note that an attribute is a compound entity that, as a whole, must be unique although individual parts need not be.) Additionally, the evaluate
accessor can be used to determine if every attribute in the set is present in the specified attribute container list.
typedef bsl::allocator<char> ball::ManagedAttributeSet::allocator_type |
|
inline |
|
inlineexplicit |
Create an empty ManagedAttributeSet
object. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
|
inline |
Create a ManagedAttributeSet
object having the same value as the specified original
object. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
|
default |
|
inline |
Add an attribute having the specified value
to this object. Return true
on success and false
if an attribute having the same value
already exists in this object.
|
inline |
Add an attribute having the specified value
to this object. Return 1 on success and 0 if an attribute having the same value already exists in this object.
|
inline |
Return an iterator referring to the first member of this attribute set.
ball::ManagedAttributeSet::BSLMF_NESTED_TRAIT_DECLARATION | ( | ManagedAttributeSet | , |
bslma::UsesBslmaAllocator | |||
) |
|
inline |
Return an iterator referring to one past the last member of this attribute set.
bool ball::ManagedAttributeSet::evaluate | ( | const AttributeContainerList & | containerList | ) | const |
Return true
if for every attribute maintained by this object, an attribute with the same name and value exists in the specified containerList
, or if this object has no attributes; otherwise return false
.
|
inline |
Return the allocator used by this object to supply memory. Note that if no allocator was supplied at construction the default allocator in effect at construction is used.
|
static |
Return a hash value calculated from the specified set
using the specified size
as the number of slots. The hash value is guaranteed to be in the range [0 .. size - 1]
. The behavior is undefined unless 0 < size
.
|
inline |
Return true
if an attribute having specified value
exists in this object, and false
otherwise.
|
inline |
|
inline |
ManagedAttributeSet & ball::ManagedAttributeSet::operator= | ( | const ManagedAttributeSet & | rhs | ) |
Assign the value of the specified rhs
to this object, and return a reference providing modifiable access to this object.
bsl::ostream & ball::ManagedAttributeSet::print | ( | bsl::ostream & | stream, |
int | level = 0 , |
||
int | spacesPerLevel = 4 |
||
) | const |
Format this object to the specified output stream
at the (absolute value of) the optionally specified indentation level
and return a reference to stream
. If level
is specified, optionally specify spacesPerLevel
, the number of spaces per indentation level for this and all of its nested objects. If level
is negative, suppress indentation of the first line. If spacesPerLevel
is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level
). If stream
is not valid on entry, this operation has no effect.
|
inline |
|
inline |
|
inline |
Remove the attribute having the specified value
from this object. Return true
on success and false
if an attribute having the value
does not exist in this object.
|
inline |
Remove the attribute having the specified value
from this object. Return the number of attributes removed (i.e., 1 on success and 0 if an attribute having value
does not exist in this object).
|
friend |
Return true
if the specified lhs
and rhs
objects do not have the same value, and false
otherwise. Two ManagedAttributeSet
objects do not have the same value if they do not have the same number of attributes or there is at least one attribute value that appears in one object, but not in the other.
|
friend |
Write the value of the specified attributeSet
to the specified output
stream. Return the specified output
stream.
|
friend |
Return true
if the specified lhs
and rhs
objects have the same value, and false
otherwise. Two ManagedAttributeSet
objects have the same value if they have the same number of attributes and every attribute value that appears in one object also appears in the other.