BDE 4.39.x Production Release
Loading...
Searching...
No Matches
ball::HierarchicalCategorySetting Class Reference

#include <ball_hierarchicalcategorysetting.h>

Detailed Description

This class represents a hierarchical category setting that consists of a category name prefix and 4 threshold level settings for categories whose name starts with that prefix. Instances of HierarchicalCategorySetting are created and manipulated by LoggerManager. All threshold levels are integral values in the range [0 .. 255].

See ball_hierarchicalcategorysetting

Public Types

typedef bsl::allocator allocator_type
 

Public Member Functions

 HierarchicalCategorySetting (const bsl::string_view &categoryPrefix, int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel, allocator_type allocator=allocator_type())
 
 HierarchicalCategorySetting (const bsl::string_view &categoryPrefix, const ThresholdAggregate &levels, allocator_type allocator=allocator_type())
 
 HierarchicalCategorySetting (const HierarchicalCategorySetting &original, const allocator_type &allocator=allocator_type())
 
 HierarchicalCategorySetting (bslmf::MovableRef< HierarchicalCategorySetting > original) BSLS_KEYWORD_NOEXCEPT
 
 HierarchicalCategorySetting (bslmf::MovableRef< HierarchicalCategorySetting > original, const allocator_type &allocator)
 
 ~HierarchicalCategorySetting ()=default
 
HierarchicalCategorySettingoperator= (const HierarchicalCategorySetting &rhs)
 
HierarchicalCategorySettingoperator= (bslmf::MovableRef< HierarchicalCategorySetting > rhs)
 
int setLevels (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
 
bsl::string_view categoryPrefix () const
 
int recordLevel () const
 
int passLevel () const
 
int triggerLevel () const
 
int triggerAllLevel () const
 
allocator_type get_allocator () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Friends

bool operator== (const HierarchicalCategorySetting &, const HierarchicalCategorySetting &)
 
bool operator!= (const HierarchicalCategorySetting &, const HierarchicalCategorySetting &)
 

Member Typedef Documentation

◆ allocator_type

Constructor & Destructor Documentation

◆ HierarchicalCategorySetting() [1/5]

ball::HierarchicalCategorySetting::HierarchicalCategorySetting ( const bsl::string_view categoryPrefix,
int  recordLevel,
int  passLevel,
int  triggerLevel,
int  triggerAllLevel,
allocator_type  allocator = allocator_type() 
)

Create a hierarchical category setting object having the specified categoryPrefix and the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel threshold values, respectively. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

Precondition
The behavior is undefined unless each of the specified threshold levels is in the range [0 .. 255].

◆ HierarchicalCategorySetting() [2/5]

ball::HierarchicalCategorySetting::HierarchicalCategorySetting ( const bsl::string_view categoryPrefix,
const ThresholdAggregate levels,
allocator_type  allocator = allocator_type() 
)

◆ HierarchicalCategorySetting() [3/5]

ball::HierarchicalCategorySetting::HierarchicalCategorySetting ( const HierarchicalCategorySetting original,
const allocator_type allocator = allocator_type() 
)

Create a hierarchical category setting object initialized to the value of 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.

◆ HierarchicalCategorySetting() [4/5]

ball::HierarchicalCategorySetting::HierarchicalCategorySetting ( bslmf::MovableRef< HierarchicalCategorySetting original)

Create a hierarchical category setting object having the same value as the specified original object, and adopting all outstanding memory allocations and the allocator associated with the original object. original is left in a valid but unspecified state.

◆ HierarchicalCategorySetting() [5/5]

ball::HierarchicalCategorySetting::HierarchicalCategorySetting ( bslmf::MovableRef< HierarchicalCategorySetting original,
const allocator_type allocator 
)

Create a hierarchical category setting object having the same value as the specified original object. The value of original is moved to the new object, and all outstanding memory allocations and the specified allocator are adopted if allocator == original.get_allocator(). original is left in a valid but unspecified state.

◆ ~HierarchicalCategorySetting()

ball::HierarchicalCategorySetting::~HierarchicalCategorySetting ( )
default

Destroy this object.

Member Function Documentation

◆ categoryPrefix()

bsl::string_view ball::HierarchicalCategorySetting::categoryPrefix ( ) const
inline

Return the name prefix of this hierarchical category setting.

◆ get_allocator()

HierarchicalCategorySetting::allocator_type ball::HierarchicalCategorySetting::get_allocator ( ) const
inline

Return the allocator used by this object to supply memory.

◆ operator=() [1/2]

HierarchicalCategorySetting & ball::HierarchicalCategorySetting::operator= ( bslmf::MovableRef< HierarchicalCategorySetting rhs)
inline

Assign to this object the hierarchical category setting of the specified rhs object, and return a reference providing modifiable access to this object. The settings of rhs are moved to this object, and all outstanding memory allocations and the allocator associated with rhs are adopted if get_allocator() == rhs.get_allocator(). rhs is left in a valid but unspecified state.

◆ operator=() [2/2]

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

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

◆ passLevel()

int ball::HierarchicalCategorySetting::passLevel ( ) const
inline

Return the pass level of this hierarchical category setting.

◆ print()

bsl::ostream & ball::HierarchicalCategorySetting::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.

Note
Note that the format is not fully specified, and can change without notice.

◆ recordLevel()

int ball::HierarchicalCategorySetting::recordLevel ( ) const
inline

Return the record level of this hierarchical category setting.

◆ setLevels()

int ball::HierarchicalCategorySetting::setLevels ( int  recordLevel,
int  passLevel,
int  triggerLevel,
int  triggerAllLevel 
)

Set the threshold levels of this hierarchical category settings object to the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel values, respectively, if each of the specified values is in the range [0 .. 255]. Return 0 on success, and a non-zero value otherwise (with no effect on the threshold levels of this object).

◆ triggerAllLevel()

int ball::HierarchicalCategorySetting::triggerAllLevel ( ) const
inline

Return the trigger-all level of this hierarchical category setting.

◆ triggerLevel()

int ball::HierarchicalCategorySetting::triggerLevel ( ) const
inline

Return the trigger level of this hierarchical category setting.

Friends And Related Symbol Documentation

◆ operator!=

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

Return true if the specified lhs and rhs hierarchical category settings do not have the same value, and false otherwise. Two such objects differ in value if their category name prefix or threshold values differ.

◆ operator==

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

Return true if the specified lhs and rhs hierarchical category settings have the same value, and false otherwise. Two such objects have the same value if they have the same category name prefix and threshold values.


The documentation for this class was generated from the following file: