8#ifndef INCLUDED_BALL_DEFAULTATTRIBUTECONTAINER
9#define INCLUDED_BALL_DEFAULTATTRIBUTECONTAINER
146#include <balscm_version.h>
159#include <bsl_functional.h>
160#include <bsl_unordered_set.h>
178 struct AttributeHash {
182 static int s_hashtableSize;
188 int operator()(
const Attribute& attribute)
const
195 static int s_initialSize;
286 int spacesPerLevel = 4) const
325bsl::ostream& operator<<(
bsl::ostream& output,
339: d_attributeSet(s_initialSize,
349: d_attributeSet(s_initialSize,
360: d_attributeSet(original.d_attributeSet, allocator)
373 return d_attributeSet.
insert(value).second;
379 return d_attributeSet.
erase(value) != 0;
385 d_attributeSet.
clear();
392 return static_cast<int>(d_attributeSet.
size());
399 return d_attributeSet.
begin();
406 return d_attributeSet.
end();
423 bsl::ostream& output,
424 const DefaultAttributeContainer& attributeContainer)
426 return attributeContainer.print(output, 0, -1);
Definition ball_attributecontainer.h:426
Definition ball_attribute.h:198
static int hash(const Attribute &attribute, int size)
Definition ball_defaultattributecontainer.h:173
void visitAttributes(const bsl::function< void(const ball::Attribute &)> &visitor) const BSLS_KEYWORD_OVERRIDE
BSLMF_NESTED_TRAIT_DECLARATION(DefaultAttributeContainer, bslma::UsesBslmaAllocator)
allocator_type get_allocator() const
Definition ball_defaultattributecontainer.h:413
bsl::unordered_set< Attribute, AttributeHash >::const_iterator const_iterator
Definition ball_defaultattributecontainer.h:215
bsl::allocator< char > allocator_type
This typedef is an alias for the allocator used by this object.
Definition ball_defaultattributecontainer.h:212
bool addAttribute(const Attribute &value)
Definition ball_defaultattributecontainer.h:371
const_iterator end() const
Return an iterator pointing at one past the end of the map.
Definition ball_defaultattributecontainer.h:404
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const BSLS_KEYWORD_OVERRIDE
bool removeAttribute(const Attribute &value)
Definition ball_defaultattributecontainer.h:377
int numAttributes() const
Return the number of attributes managed by this object.
Definition ball_defaultattributecontainer.h:390
void removeAllAttributes()
Remove every attribute in this attribute set.
Definition ball_defaultattributecontainer.h:383
bool hasValue(const Attribute &value) const BSLS_KEYWORD_OVERRIDE
~DefaultAttributeContainer() BSLS_KEYWORD_OVERRIDE
Destroy this object.
Definition ball_defaultattributecontainer.h:365
DefaultAttributeContainer()
Definition ball_defaultattributecontainer.h:338
const_iterator begin() const
Definition ball_defaultattributecontainer.h:397
Definition bslma_bslallocator.h:580
Definition bslstl_unorderedset.h:704
void swap(unordered_set &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits void clear() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedset.h:1219
pair< iterator, bool > insert(const value_type &value)
Definition bslstl_unorderedset.h:2283
unordered_set &operator=(BloombergLP::bslmf::MovableRef< unordered_set > rhs) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits iterator begin() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedset.h:2126
ALLOCATOR get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedset.h:2411
iterator end() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_unorderedset.h:2134
iterator erase(const_iterator position)
Definition bslstl_unorderedset.h:2224
size_type size() const BSLS_KEYWORD_NOEXCEPT
Return the number of elements in this set.
Definition bslstl_unorderedset.h:2469
iterator const_iterator
Definition bslstl_unorderedset.h:767
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_OVERRIDE
Definition bsls_keyword.h:653
Definition ball_administration.h:214
bsl::ostream & operator<<(bsl::ostream &output, const Attribute &attribute)
Definition bdlb_printmethods.h:283
Definition bslma_usesbslmaallocator.h:343