[#BloombergLP-balm-MetricFormat] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::MetricFormat :relfileprefix: ../../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class MetricFormat; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/MetricFormat/2constructor-0d6.adoc[`MetricFormat`] [.small]#[constructor]# | Constructors | xref:BloombergLP/balm/MetricFormat/operator_assign.adoc[`operator=`] | Assign to this metric format object the value of the specified `rhs` metric format, and return a reference to this modifiable metric format. | xref:BloombergLP/balm/MetricFormat/clearFormatSpec.adoc[`clearFormatSpec`] | Remove the format spec for the specified `publicationType` from this metric format object. After this methods returns, `formatSpec(publicationType)` will return 0. | xref:BloombergLP/balm/MetricFormat/clearFormatSpecs.adoc[`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. | xref:BloombergLP/balm/MetricFormat/formatSpec.adoc[`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`. | xref:BloombergLP/balm/MetricFormat/print.adoc[`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. | xref:BloombergLP/balm/MetricFormat/setFormatSpec.adoc[`setFormatSpec`] | Set the format spec for the metric aggregate indicated by the specified `publicationType` to the specified `formatSpec`. | xref:BloombergLP/balm/MetricFormat/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<MetricFormat, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/balm/operator_eq-0c.adoc[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 [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/operator_not_eq-0e.adoc[`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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#