#include <ball_managedattribute.h>
|
| BSLMF_NESTED_TRAIT_DECLARATION (ManagedAttribute, bslma::UsesBslmaAllocator) |
|
| ManagedAttribute (const Attribute &attribute, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, const bsl::string_view &value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, const char *value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, int value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, long value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, long long value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, unsigned int value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, unsigned long value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, unsigned long long value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, const void *value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const bsl::string_view &name, const Attribute::Value &value, const allocator_type &allocator=allocator_type()) |
|
| ManagedAttribute (const ManagedAttribute &original, const allocator_type &allocator=allocator_type()) |
|
| ~ManagedAttribute ()=default |
| Destroy this object.
|
|
ManagedAttribute & | operator= (const ManagedAttribute &rhs) |
|
void | setName (const bsl::string_view &name) |
| Set the attribute name of this object to the specified name .
|
|
void | setValue (int value) |
|
void | setValue (long value) |
|
void | setValue (long long value) |
|
void | setValue (unsigned int value) |
|
void | setValue (unsigned long value) |
|
void | setValue (unsigned long long value) |
|
void | setValue (const bsl::string_view &value) |
|
void | setValue (const Attribute::Value &value) |
|
void | setValue (const char *value) |
|
void | setValue (const void *value) |
| Set the attribute value of this object to the specified value .
|
|
const Attribute & | attribute () const |
| Return a const reference to the attribute of this object.
|
|
allocator_type | get_allocator () const |
|
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
|
const bsl::string & | key () const |
| Return a const reference to the attribute name of this object.
|
|
const char * | name () const |
|
const Attribute::Value & | value () const |
| Return a const reference to the attribute value of this object.
|
|
A ball::ManagedAttribute
object contains a ball::Attribute
object and provides storage for the attribute's name.
See ball_managedattribute
◆ allocator_type
◆ ManagedAttribute() [1/12]
Create a ManagedAttribute
object having the value of the specified attribute
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ ManagedAttribute() [2/12]
Create a ManagedAttribute
object having the specified name
and string value
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ ManagedAttribute() [3/12]
Create a ManagedAttribute
object having the specified name
and the C-style value
string. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ ManagedAttribute() [4/12]
◆ ManagedAttribute() [5/12]
◆ ManagedAttribute() [6/12]
◆ ManagedAttribute() [7/12]
◆ ManagedAttribute() [8/12]
◆ ManagedAttribute() [9/12]
Create a ManagedAttribute
object having the specified name
and value
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ ManagedAttribute() [10/12]
Create a ManagedAttribute
object having the specified name
and the pointer to the specified value
of cv-qualified void
type. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ ManagedAttribute() [11/12]
Create a ManagedAttribute
object having the specified name
and value
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ ManagedAttribute() [12/12]
Create a ManagedAttribute
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.
◆ ~ManagedAttribute()
ball::ManagedAttribute::~ManagedAttribute |
( |
| ) |
|
|
default |
◆ attribute()
const Attribute & ball::ManagedAttribute::attribute |
( |
| ) |
const |
|
inline |
◆ BSLMF_NESTED_TRAIT_DECLARATION()
◆ 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.
◆ hash()
int ball::ManagedAttribute::hash |
( |
const ManagedAttribute & |
attribute, |
|
|
int |
size |
|
) |
| |
|
inlinestatic |
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
.
◆ key()
const bsl::string & ball::ManagedAttribute::key |
( |
| ) |
const |
|
inline |
◆ name()
const char * ball::ManagedAttribute::name |
( |
| ) |
const |
|
inline |
Return the attribute name of this object. Note that this accessor should not be used to get the attribute name if the name string contains embedded zeros.
- Deprecated:
- Use key() instead.
◆ operator=()
Assign to this object the value of the specified rhs
object, and return a non-const
reference to this object.
◆ print()
bsl::ostream & ball::ManagedAttribute::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.
◆ setName()
◆ setValue() [1/10]
◆ setValue() [2/10]
◆ setValue() [3/10]
void ball::ManagedAttribute::setValue |
( |
const char * |
value | ) |
|
|
inline |
◆ setValue() [4/10]
void ball::ManagedAttribute::setValue |
( |
const void * |
value | ) |
|
|
inline |
◆ setValue() [5/10]
void ball::ManagedAttribute::setValue |
( |
int |
value | ) |
|
|
inline |
◆ setValue() [6/10]
void ball::ManagedAttribute::setValue |
( |
long long |
value | ) |
|
|
inline |
◆ setValue() [7/10]
void ball::ManagedAttribute::setValue |
( |
long |
value | ) |
|
|
inline |
◆ setValue() [8/10]
void ball::ManagedAttribute::setValue |
( |
unsigned int |
value | ) |
|
|
inline |
◆ setValue() [9/10]
void ball::ManagedAttribute::setValue |
( |
unsigned long long |
value | ) |
|
|
inline |
◆ setValue() [10/10]
void ball::ManagedAttribute::setValue |
( |
unsigned long |
value | ) |
|
|
inline |
◆ value()
◆ operator!=
Return true
if the specified lhs
and rhs
objects do not have the same value, and false
otherwise. Two ManagedAttribute
objects do not have the same value if any of their respective names, attribute value types, or attribute values differ.
◆ operator<<
Write the value of the specified attribute
to the specified output
stream. Return the specified output
stream.
◆ operator==
Return true
if the specified lhs
and rhs
objects have the same value, and false
otherwise. Two ManagedAttribute
objects have the same value if they have the same name, same attribute value type, and the same attribute value.
The documentation for this class was generated from the following file: