#include <ball_attribute.h>
|
| BSLMF_NESTED_TRAIT_DECLARATION (Attribute, bslma::UsesBslmaAllocator) |
|
| Attribute (const char *name, const bsl::string_view &value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, const char *value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, int value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, long value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, long long value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, unsigned int value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, unsigned long value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, unsigned long long value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, bdlb::Guid value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, const void *value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const char *name, const Value &value, const allocator_type &allocator=allocator_type()) |
|
| Attribute (const Attribute &original, const allocator_type &allocator=allocator_type()) |
|
| ~Attribute ()=default |
| Destroy this object.
|
|
Attribute & | operator= (const Attribute &rhs) |
| Assign the value of the specified rhs object to this object.
|
|
void | setName (const char *name) |
|
void | setValue (const Value &value) |
|
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 (bdlb::Guid value) |
|
void | setValue (const bsl::string_view &value) |
|
void | setValue (const char *value) |
|
void | setValue (const void *value) |
| Set the attribute value of this object to the specified value .
|
|
const char * | name () const |
| Return the name of this object.
|
|
const Value & | value () const |
|
bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
|
allocator_type | get_allocator () const |
|
An Attribute
object contains an attribute name which is not managed and an attribute value which is managed.
See ball_attribute
◆ allocator_type
◆ Value
◆ Attribute() [1/12]
Create an Attribute
object having the specified (literal) name
and (character string) value
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used. Note that name
is not managed by this object and therefore must remain valid while in use by any Attribute
object.
◆ Attribute() [2/12]
Create an Attribute
object having the specified (literal) name
and (character string) value
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used. Note that name
is not managed by this object and therefore must remain valid while in use by any Attribute
object.
◆ Attribute() [3/12]
◆ Attribute() [4/12]
◆ Attribute() [5/12]
◆ Attribute() [6/12]
◆ Attribute() [7/12]
◆ Attribute() [8/12]
◆ Attribute() [9/12]
Create an Attribute
object having the specified (literal) 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. Note that name
is not managed by this object and therefore must remain valid while in use by any Attribute
object.
◆ Attribute() [10/12]
Create an Attribute
object having the specified (literal) name
and (const-qualified void pointer) value
. Optionally specify an allocator
(e.g., the address of a bslma::Allocator
object) to supply memory; otherwise, the default allocator is used.
◆ Attribute() [11/12]
Create an Attribute
object having the specified (literal) 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. Note that name
is not managed by this object and therefore must remain valid while in use by any Attribute
object.
◆ Attribute() [12/12]
Create an Attribute
object having the same (literal) name and attribute 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.
◆ ~Attribute()
ball::Attribute::~Attribute |
( |
| ) |
|
|
default |
◆ 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()
static int ball::Attribute::hash |
( |
const Attribute & |
attribute, |
|
|
int |
size |
|
) |
| |
|
static |
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
.
◆ name()
const char * ball::Attribute::name |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ print()
bsl::ostream & ball::Attribute::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()
void ball::Attribute::setName |
( |
const char * |
name | ) |
|
|
inline |
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() [1/11]
void ball::Attribute::setValue |
( |
bdlb::Guid |
value | ) |
|
|
inline |
◆ setValue() [2/11]
◆ setValue() [3/11]
void ball::Attribute::setValue |
( |
const char * |
value | ) |
|
|
inline |
◆ setValue() [4/11]
void ball::Attribute::setValue |
( |
const Value & |
value | ) |
|
|
inline |
◆ setValue() [5/11]
void ball::Attribute::setValue |
( |
const void * |
value | ) |
|
|
inline |
◆ setValue() [6/11]
void ball::Attribute::setValue |
( |
int |
value | ) |
|
|
inline |
◆ setValue() [7/11]
void ball::Attribute::setValue |
( |
long long |
value | ) |
|
|
inline |
◆ setValue() [8/11]
void ball::Attribute::setValue |
( |
long |
value | ) |
|
|
inline |
◆ setValue() [9/11]
void ball::Attribute::setValue |
( |
unsigned int |
value | ) |
|
|
inline |
◆ setValue() [10/11]
void ball::Attribute::setValue |
( |
unsigned long long |
value | ) |
|
|
inline |
◆ setValue() [11/11]
void ball::Attribute::setValue |
( |
unsigned long |
value | ) |
|
|
inline |
◆ value()
Return a reference to the non-modifiable attribute value of this object.
◆ 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.
◆ operator<<
bsl::ostream & operator<< |
( |
bsl::ostream & |
, |
|
|
const Attribute & |
|
|
) |
| |
|
friend |
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 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.
The documentation for this class was generated from the following file: