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

#include <ball_managedattribute.h>

Public Types

typedef bsl::allocator< char > allocator_type
 

Public Member Functions

 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.
 
ManagedAttributeoperator= (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 Attributeattribute () 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::stringkey () const
 Return a const reference to the attribute name of this object.
 
const char * name () const
 
const Attribute::Valuevalue () const
 Return a const reference to the attribute value of this object.
 

Static Public Member Functions

static int hash (const ManagedAttribute &attribute, int size)
 

Friends

bool operator== (const ManagedAttribute &, const ManagedAttribute &)
 
bool operator!= (const ManagedAttribute &, const ManagedAttribute &)
 
bsl::ostream & operator<< (bsl::ostream &, const ManagedAttribute &)
 

Detailed Description

A ball::ManagedAttribute object contains a ball::Attribute object and provides storage for the attribute's name.

See ball_managedattribute

Member Typedef Documentation

◆ allocator_type

Constructor & Destructor Documentation

◆ ManagedAttribute() [1/12]

ball::ManagedAttribute::ManagedAttribute ( const Attribute attribute,
const allocator_type allocator = allocator_type() 
)
inlineexplicit

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]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
const bsl::string_view value,
const allocator_type allocator = allocator_type() 
)
inline

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]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
const char *  value,
const allocator_type allocator = allocator_type() 
)
inline

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]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
int  value,
const allocator_type allocator = allocator_type() 
)
inline

◆ ManagedAttribute() [5/12]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
long  value,
const allocator_type allocator = allocator_type() 
)
inline

◆ ManagedAttribute() [6/12]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
long long  value,
const allocator_type allocator = allocator_type() 
)
inline

◆ ManagedAttribute() [7/12]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
unsigned int  value,
const allocator_type allocator = allocator_type() 
)
inline

◆ ManagedAttribute() [8/12]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
unsigned long  value,
const allocator_type allocator = allocator_type() 
)
inline

◆ ManagedAttribute() [9/12]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
unsigned long long  value,
const allocator_type allocator = allocator_type() 
)
inline

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]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
const void *  value,
const allocator_type allocator = allocator_type() 
)
inline

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]

ball::ManagedAttribute::ManagedAttribute ( const bsl::string_view name,
const Attribute::Value value,
const allocator_type allocator = allocator_type() 
)
inline

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]

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

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

Member Function Documentation

◆ attribute()

const Attribute & ball::ManagedAttribute::attribute ( ) const
inline

◆ BSLMF_NESTED_TRAIT_DECLARATION()

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

◆ get_allocator()

ManagedAttribute::allocator_type ball::ManagedAttribute::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.

◆ 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=()

ManagedAttribute & ball::ManagedAttribute::operator= ( const ManagedAttribute rhs)
inline

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()

void ball::ManagedAttribute::setName ( const bsl::string_view name)
inline

◆ setValue() [1/10]

void ball::ManagedAttribute::setValue ( const Attribute::Value value)
inline

◆ setValue() [2/10]

void ball::ManagedAttribute::setValue ( const bsl::string_view value)
inline

◆ 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()

const Attribute::Value & ball::ManagedAttribute::value ( ) const
inline

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const ManagedAttribute ,
const ManagedAttribute  
)
friend

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

bsl::ostream & operator<< ( bsl::ostream &  ,
const ManagedAttribute  
)
friend

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

◆ operator==

bool operator== ( const ManagedAttribute ,
const ManagedAttribute  
)
friend

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: