BDE 4.14.0 Production release
Loading...
Searching...
No Matches
ball::DefaultAttributeContainer Class Reference

#include <ball_defaultattributecontainer.h>

Inheritance diagram for ball::DefaultAttributeContainer:
ball::AttributeContainer

Public Types

typedef bsl::allocator< char > allocator_type
 This typedef is an alias for the allocator used by this object.
 
typedef bsl::unordered_set< Attribute, AttributeHash >::const_iterator const_iterator
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (DefaultAttributeContainer, bslma::UsesBslmaAllocator)
 
 DefaultAttributeContainer ()
 
 DefaultAttributeContainer (const allocator_type &allocator)
 
 DefaultAttributeContainer (const DefaultAttributeContainer &original, const allocator_type &allocator=allocator_type())
 
 ~DefaultAttributeContainer () BSLS_KEYWORD_OVERRIDE
 Destroy this object.
 
DefaultAttributeContaineroperator= (const DefaultAttributeContainer &rhs)
 
bool addAttribute (const Attribute &value)
 
bool removeAttribute (const Attribute &value)
 
void removeAllAttributes ()
 Remove every attribute in this attribute set.
 
int numAttributes () const
 Return the number of attributes managed by this object.
 
bool hasValue (const Attribute &value) const BSLS_KEYWORD_OVERRIDE
 
const_iterator begin () const
 
const_iterator end () const
 Return an iterator pointing at one past the end of the map.
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const BSLS_KEYWORD_OVERRIDE
 
void visitAttributes (const bsl::function< void(const ball::Attribute &)> &visitor) const BSLS_KEYWORD_OVERRIDE
 
allocator_type get_allocator () const
 
- Public Member Functions inherited from ball::AttributeContainer
virtual ~AttributeContainer ()
 Destroy this object.
 

Detailed Description

A DefaultAttributeContainer object contains a collection of (unique) attributes values.

See ball_defaultattributecontainer

Member Typedef Documentation

◆ allocator_type

◆ const_iterator

Constructor & Destructor Documentation

◆ DefaultAttributeContainer() [1/3]

ball::DefaultAttributeContainer::DefaultAttributeContainer ( )
inline

◆ DefaultAttributeContainer() [2/3]

ball::DefaultAttributeContainer::DefaultAttributeContainer ( const allocator_type allocator)
inlineexplicit

Create an empty DefaultAttributeContainer object. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

◆ DefaultAttributeContainer() [3/3]

ball::DefaultAttributeContainer::DefaultAttributeContainer ( const DefaultAttributeContainer original,
const allocator_type allocator = allocator_type() 
)
inline

Create a DefaultAttributeContainer 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.

◆ ~DefaultAttributeContainer()

ball::DefaultAttributeContainer::~DefaultAttributeContainer ( )
inline

Member Function Documentation

◆ addAttribute()

bool ball::DefaultAttributeContainer::addAttribute ( const Attribute value)
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.

◆ begin()

DefaultAttributeContainer::const_iterator ball::DefaultAttributeContainer::begin ( ) const
inline

Return an iterator pointing at the beginning of the (unordered) sequence of attributes managed by this map, or end() if numAttributes() is 0.

◆ BSLMF_NESTED_TRAIT_DECLARATION()

ball::DefaultAttributeContainer::BSLMF_NESTED_TRAIT_DECLARATION ( DefaultAttributeContainer  ,
bslma::UsesBslmaAllocator   
)

◆ end()

DefaultAttributeContainer::const_iterator ball::DefaultAttributeContainer::end ( ) const
inline

◆ get_allocator()

DefaultAttributeContainer::allocator_type ball::DefaultAttributeContainer::get_allocator ( ) const
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.

◆ hasValue()

bool ball::DefaultAttributeContainer::hasValue ( const Attribute value) const
virtual

Return true if the attribute having specified value exists in this object, and false otherwise.

Implements ball::AttributeContainer.

◆ numAttributes()

int ball::DefaultAttributeContainer::numAttributes ( ) const
inline

◆ operator=()

DefaultAttributeContainer & ball::DefaultAttributeContainer::operator= ( const DefaultAttributeContainer rhs)

Assign to this object the value of the specified rhs object, and return a non-const reference to this object.

◆ print()

bsl::ostream & ball::DefaultAttributeContainer::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const
virtual

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.

Implements ball::AttributeContainer.

◆ removeAllAttributes()

void ball::DefaultAttributeContainer::removeAllAttributes ( )
inline

◆ removeAttribute()

bool ball::DefaultAttributeContainer::removeAttribute ( const Attribute value)
inline

Remove the attribute having the specified value from this object. Return the true on success and false if the attribute having the value does not exist in this object.

◆ visitAttributes()

void ball::DefaultAttributeContainer::visitAttributes ( const bsl::function< void(const ball::Attribute &)> &  visitor) const
virtual

Invoke the specified visitor function for all attributes in this container.

Implements ball::AttributeContainer.


The documentation for this class was generated from the following file: