An Attribute object contains an attribute name which is not managed and an attribute value which is managed.

Synopsis

Declared in <ball_attribute.h>

class Attribute;

Type Aliases

Name

Description

Value

Value is an alias for the attribute type variant.

allocator_type

This typedef is an alias for the allocator used by this object.

Member Functions

Name

Description

Attribute [constructor]

Constructors

operator=

Assign the value of the specified rhs object to this object.

get_allocator

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.

name

Return the name of this object.

print

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.

setName

Set the attribute name of this object to the specified (literal) name. Note that name is not managed by this object and therefore must remain valid while in use by any Attribute object.

setValue

setValue overloads

value

Return a reference to the non‐modifiable attribute value of this object.

operator BloombergLP::bslmf::NestedTraitDeclaration<Attribute, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Static Member Functions

Name

Description

hash

Return a hash value calculated from the specified attribute 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.

Friends

Name

Description

BloombergLP::ball::operator<<

Write the value of the specified attribute to the specified output stream. Return the specified output stream.

BloombergLP::ball::operator!=

Return true if the specified lhs and rhs objects do not have the same value, and false otherwise. Two Attribute objects do not have the same value if any of their respective names (value, not address), attribute value types, or attribute values differ.

BloombergLP::ball::operator==

Return true if the specified lhs and rhs objects have the same value, and false otherwise. Two Attribute objects have the same value if they have the same name (but not necessarily the identical representation in memory), the same attribute value type, and the same attribute value.

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs and rhs objects do not have the same value, and false otherwise.

operator==

Return true if the specified lhs and rhs objects have the same value, and false otherwise.

Created with MrDocs