Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions

ball::ScopedAttribute Class Reference

#include <ball_scopedattribute.h>

List of all members.

Public Types

typedef bsl::allocator< char > allocator_type

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (ScopedAttribute, bslma::UsesBslmaAllocator)
 ScopedAttribute (const char *name, const bsl::string_view &value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, const char *value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, int value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, long value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, long long value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, unsigned int value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, unsigned long value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, unsigned long long value, const allocator_type &allocator=allocator_type())
 ScopedAttribute (const char *name, const void *value, const allocator_type &allocator=allocator_type())
 ~ScopedAttribute ()
allocator_type get_allocator () const

Detailed Description

This class provides a scoped guard that sets a single BALL attribute in the current thread.

See Component ball_scopedattribute


Member Typedef Documentation


Constructor & Destructor Documentation

ball::ScopedAttribute::ScopedAttribute ( const char *  name,
const bsl::string_view &  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
const char *  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
int  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
long  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
long long  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
unsigned int  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
unsigned long  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
unsigned long long  value,
const allocator_type allocator = allocator_type() 
)
ball::ScopedAttribute::ScopedAttribute ( const char *  name,
const void *  value,
const allocator_type allocator = allocator_type() 
)

Set BALL logging attributes for the current thread for the scope of this object, associating the specified name with the specified value. Optionally specify an allocator (e.g., the address of a bslma::Allocator object) to supply memory; otherwise, the default allocator is used.

ball::ScopedAttribute::~ScopedAttribute (  ) 

Remove the attributes managed by this object from the BALL system, and destroy this object.


Member Function Documentation

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