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

#include <ball_thresholdaggregate.h>

Public Member Functions

 ThresholdAggregate ()
 Create a threshold aggregate whose threshold levels are all 0.
 
 ThresholdAggregate (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
 
 ThresholdAggregate (const ThresholdAggregate &original)
 
 ~ThresholdAggregate ()=default
 Destroy this object.
 
ThresholdAggregateoperator= (const ThresholdAggregate &rhs)
 
int setLevels (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
 
void setRecordLevel (int recordLevel)
 
void setPassLevel (int passLevel)
 
void setTriggerLevel (int triggerLevel)
 
void setTriggerAllLevel (int triggerAllLevel)
 
int recordLevel () const
 Return the record level of this threshold aggregate.
 
int passLevel () const
 Return the pass level of this threshold aggregate.
 
int triggerLevel () const
 Return the trigger level of this threshold aggregate.
 
int triggerAllLevel () const
 Return the trigger-all level of this threshold aggregate.
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Static Public Member Functions

static int hash (const ThresholdAggregate &aggregate, int size)
 
static bool areValidThresholdLevels (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
 
static int maxLevel (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
 
static int maxLevel (const ThresholdAggregate &aggregate)
 

Friends

bool operator== (const ThresholdAggregate &, const ThresholdAggregate &)
 

Detailed Description

This class implements an aggregate of the four logging threshold levels.

See ball_thresholdaggregate

Constructor & Destructor Documentation

◆ ThresholdAggregate() [1/3]

ball::ThresholdAggregate::ThresholdAggregate ( )
inline

◆ ThresholdAggregate() [2/3]

ball::ThresholdAggregate::ThresholdAggregate ( int  recordLevel,
int  passLevel,
int  triggerLevel,
int  triggerAllLevel 
)
inline

Create a threshold aggregate whose threshold levels are the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel, respectively. The behavior is undefined if any threshold level is not in the range [0 .. 255].

◆ ThresholdAggregate() [3/3]

ball::ThresholdAggregate::ThresholdAggregate ( const ThresholdAggregate original)
inline

Create a threshold aggregate having the same value as that of the specified original threshold aggregate.

◆ ~ThresholdAggregate()

ball::ThresholdAggregate::~ThresholdAggregate ( )
default

Member Function Documentation

◆ areValidThresholdLevels()

bool ball::ThresholdAggregate::areValidThresholdLevels ( int  recordLevel,
int  passLevel,
int  triggerLevel,
int  triggerAllLevel 
)
inlinestatic

Return true if each of the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel threshold values is in the range [0 .. 255], and false otherwise.

◆ hash()

static int ball::ThresholdAggregate::hash ( const ThresholdAggregate aggregate,
int  size 
)
static

Return a hash value calculated from the specified threshold aggregate 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.

◆ maxLevel() [1/2]

int ball::ThresholdAggregate::maxLevel ( const ThresholdAggregate aggregate)
inlinestatic

Return the numerically greatest of the four logging threshold levels held by the specified threshold aggregate.

◆ maxLevel() [2/2]

static int ball::ThresholdAggregate::maxLevel ( int  recordLevel,
int  passLevel,
int  triggerLevel,
int  triggerAllLevel 
)
static

Return the numerically greatest of the specified recordLevel, passLevel, triggerLevel, and triggerAllLevel values.

◆ operator=()

ThresholdAggregate & ball::ThresholdAggregate::operator= ( const ThresholdAggregate rhs)

Assign the value of the specified rhs threshold aggregate to this aggregate, and return a reference to this modifiable aggregate.

◆ passLevel()

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

◆ print()

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

◆ recordLevel()

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

◆ setLevels()

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

Set the threshold levels of this threshold aggregate 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 aggregate).

◆ setPassLevel()

void ball::ThresholdAggregate::setPassLevel ( int  passLevel)
inline

Set the pass level of this threshold aggregate to the specified passLevel.

◆ setRecordLevel()

void ball::ThresholdAggregate::setRecordLevel ( int  recordLevel)
inline

Set the record level of this threshold aggregate to the specified recordLevel.

◆ setTriggerAllLevel()

void ball::ThresholdAggregate::setTriggerAllLevel ( int  triggerAllLevel)
inline

Set the trigger-all level of this threshold aggregate to the specified triggerAllLevel.

◆ setTriggerLevel()

void ball::ThresholdAggregate::setTriggerLevel ( int  triggerLevel)
inline

Set the trigger level of this threshold aggregate to the specified triggerLevel.

◆ triggerAllLevel()

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

◆ triggerLevel()

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

Friends And Related Symbol Documentation

◆ operator==

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

Return true if the specified lhs and rhs threshold aggregates have the same value, and false otherwise. Two threshold aggregates have the same value if all four of their respective threshold levels are the same.


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