This class provides a value‐semantic description for the formatting of a metric. For each published aggregate type of a metric (e.g., count, total, min, max, etc.), a MetricFormat contains a MetricFormatSpec object describing how to format values of that aggregate, or null if no formatting information is supplied. Metricformat provides the setFormatSpec method to set the format spec for a publication type, and the formatSpec method to retrieve the format spec for a publication type (or 0 if no format spec has been provided for the indicated publication type). Note that the types of published aggregates explicitly provided by the balm package are defined in the PublicationType enumeration.

Synopsis

Declared in <balm_metricformat.h>

class MetricFormat;

Member Functions

Name

Description

MetricFormat [constructor]

Constructors

operator=

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

clearFormatSpec

Remove the format spec for the specified publicationType from this metric format object. After this methods returns, formatSpec(publicationType) will return 0.

clearFormatSpecs

Remove all format specs from this metric format object and put this object into its default‐constructed state. After this method returns, formatSpec will return 0 for all supplied publication types.

formatSpec

Return the address of the non‐modifiable format spec for the specified publicationType, or 0 if no format spec has been provided for publicationType.

print

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.

setFormatSpec

Set the format spec for the metric aggregate indicated by the specified publicationType to the specified formatSpec.

operator BloombergLP::bslmf::NestedTraitDeclaration<MetricFormat, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Friends

Name

Description

BloombergLP::balm::operator==

Return true if the specified lhs and rhs metric formats have the same value, and false otherwise. Two metric formats have the same value if they have the same value for formatSpec for each of the enumerated publication types.

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs and rhs metric formats do not have the same value, and false otherwise. Two metric formats do not have same value if they differ in their formatSpec for any of the enumerated publication types.

Created with MrDocs