BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balm::MetricFormatSpec Class Reference

#include <balm_metricformat.h>

Public Member Functions

 MetricFormatSpec ()
 
 MetricFormatSpec (float scale, const char *format)
 
 MetricFormatSpec (const MetricFormatSpec &original)
 
 ~MetricFormatSpec ()
 Destroy this object.
 
MetricFormatSpecoperator= (const MetricFormatSpec &rhs)
 
void setScale (float scale)
 
void setFormat (const char *format)
 
float scale () const
 
const char * format () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=-1) const
 

Static Public Member Functions

static bsl::ostream & formatValue (bsl::ostream &stream, double value, const MetricFormatSpec &format)
 

Detailed Description

This class provides a value-semantic representation of the formatting specification for a metric aggregate value. The scale() is a multiplier used to scale the numeric value. The format() is a printf-style format string suitable for formatting a single floating-point value.

See balm_metricformat

Constructor & Destructor Documentation

◆ MetricFormatSpec() [1/3]

balm::MetricFormatSpec::MetricFormatSpec ( )
inline

Create a metric format spec having default values for scale and format. The default value for scale is 1.0 and the default value for format is "%f".

◆ MetricFormatSpec() [2/3]

balm::MetricFormatSpec::MetricFormatSpec ( float  scale,
const char *  format 
)
inline

Create a metric format spec having the specified scale and format. The scale indicates the multiplier that may be used when formatting values, and format must be a printf-style format string for formatting a single floating-point value. The behavior is undefined unless format is null-terminated, contains a printf-style format string valid for a single floating-point value, and remains valid and unmodified for the lifetime of this object.

◆ MetricFormatSpec() [3/3]

balm::MetricFormatSpec::MetricFormatSpec ( const MetricFormatSpec original)
inline

Create a metric format spec having the same value as the specified original format spec. The behavior is undefined unless original.format() remains valid and unmodified for the lifetime of this object.

◆ ~MetricFormatSpec()

balm::MetricFormatSpec::~MetricFormatSpec ( )

Member Function Documentation

◆ format()

const char * balm::MetricFormatSpec::format ( ) const
inline

Return the address of the null-terminated string containing the printf-style format that may be used to format values.

◆ formatValue()

static bsl::ostream & balm::MetricFormatSpec::formatValue ( bsl::ostream &  stream,
double  value,
const MetricFormatSpec format 
)
static

Write the specified value to the specified stream using the specified format, and return a reference to the modifiable stream.

◆ operator=()

MetricFormatSpec & balm::MetricFormatSpec::operator= ( const MetricFormatSpec rhs)
inline

Assign to this format spec the value of the specified rhs format spec, and return a reference to this modifiable format spec.

◆ print()

bsl::ostream & balm::MetricFormatSpec::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = -1 
) 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.

◆ scale()

float balm::MetricFormatSpec::scale ( ) const
inline

Return the floating-point multiplier value that may be applied to scale formatted values.

◆ setFormat()

void balm::MetricFormatSpec::setFormat ( const char *  format)
inline

Set, to the specified format, the printf-style formatting string that may be applied when formatting values. The behavior is undefined unless format is null-terminated, contains a printf-style format string valid for a single floating-point value, and remains valid and unmodified for the lifetime of this object.

◆ setScale()

void balm::MetricFormatSpec::setScale ( float  scale)
inline

Set, to the specified scale, the scale multiplier that may be applied when formatting values.


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