Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Static Public Member Functions | Friends

ball::ThresholdAggregate Class Reference

#include <ball_thresholdaggregate.h>

List of all members.

Public Member Functions

 ThresholdAggregate ()
 ThresholdAggregate (int recordLevel, int passLevel, int triggerLevel, int triggerAllLevel)
 ThresholdAggregate (const ThresholdAggregate &original)
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
int passLevel () const
int triggerLevel () const
int triggerAllLevel () const
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 Component ball_thresholdaggregate


Constructor & Destructor Documentation

ball::ThresholdAggregate::ThresholdAggregate (  ) 

Create a threshold aggregate whose threshold levels are all 0.

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

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

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

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


Member Function Documentation

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.

static bool ball::ThresholdAggregate::areValidThresholdLevels ( int  recordLevel,
int  passLevel,
int  triggerLevel,
int  triggerAllLevel 
) [static]

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

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.

static int ball::ThresholdAggregate::maxLevel ( const ThresholdAggregate aggregate  )  [static]

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

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.

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

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

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

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

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

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

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

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

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

int ball::ThresholdAggregate::recordLevel (  )  const

Return the record level of this threshold aggregate.

int ball::ThresholdAggregate::passLevel (  )  const

Return the pass level of this threshold aggregate.

int ball::ThresholdAggregate::triggerLevel (  )  const

Return the trigger level of this threshold aggregate.

int ball::ThresholdAggregate::triggerAllLevel (  )  const

Return the trigger-all level of this threshold aggregate.

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.


Friends And Related Function Documentation

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: