Quick Links:

bal | bbl | bdl | bsl

Classes | Public Types | Public Member Functions

ball::DefaultAttributeContainer Class Reference

#include <ball_defaultattributecontainer.h>

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

List of all members.

Classes

struct  AttributeHash

Public Types

typedef bsl::allocator< char > allocator_type
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())
virtual ~DefaultAttributeContainer ()
DefaultAttributeContaineroperator= (const DefaultAttributeContainer &rhs)
bool addAttribute (const Attribute &value)
bool removeAttribute (const Attribute &value)
void removeAllAttributes ()
int numAttributes () const
virtual bool hasValue (const Attribute &value) const
const_iterator begin () const
const_iterator end () const
virtual bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
virtual void visitAttributes (const bsl::function< void(const ball::Attribute &)> &visitor) const
allocator_type get_allocator () const

Detailed Description

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

See Component ball_defaultattributecontainer


Member Typedef Documentation


Constructor & Destructor Documentation

ball::DefaultAttributeContainer::DefaultAttributeContainer (  ) 
ball::DefaultAttributeContainer::DefaultAttributeContainer ( const allocator_type allocator  )  [explicit]

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.

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

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.

virtual ball::DefaultAttributeContainer::~DefaultAttributeContainer (  )  [virtual]

Destroy this object.


Member Function Documentation

ball::DefaultAttributeContainer::BSLMF_NESTED_TRAIT_DECLARATION ( DefaultAttributeContainer  ,
bslma::UsesBslmaAllocator   
)
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.

bool ball::DefaultAttributeContainer::addAttribute ( const Attribute value  ) 

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.

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

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.

void ball::DefaultAttributeContainer::removeAllAttributes (  ) 

Remove every attribute in this attribute set.

int ball::DefaultAttributeContainer::numAttributes (  )  const

Return the number of attributes managed by this object.

virtual 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.

const_iterator ball::DefaultAttributeContainer::begin (  )  const

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

const_iterator ball::DefaultAttributeContainer::end (  )  const

Return an iterator pointing at one past the end of the map.

virtual 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.

virtual 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.

allocator_type ball::DefaultAttributeContainer::get_allocator (  )  const

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.


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