[#BloombergLP-balm-MetricFormat]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::MetricFormat
:relfileprefix: ../../
:mrdocs:

This class provides a value&hyphen;semantic description for the formatting of a metric&period; For each published aggregate type of a metric (e&period;g&period;, count, total, min, max, etc&period;), a `MetricFormat` contains a `MetricFormatSpec` object describing how to format values of that aggregate, or null if no formatting information is supplied&period; `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)&period; Note that the types of published aggregates explicitly provided by the `balm` package are defined in the `PublicationType` enumeration&period;

== Synopsis

Declared in `&lt;balm&lowbar;metricformat&period;h&gt;`

[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&equals;`] 
| Assign to this metric format object the value of the specified `rhs` metric format, and return a reference to this modifiable metric format&period;
| xref:BloombergLP/balm/MetricFormat/clearFormatSpec.adoc[`clearFormatSpec`] 
| Remove the format spec for the specified `publicationType` from this metric format object&period; After this methods returns, `formatSpec(publicationType)` will return 0&period;
| xref:BloombergLP/balm/MetricFormat/clearFormatSpecs.adoc[`clearFormatSpecs`] 
| Remove all format specs from this metric format object and put this object into its default&hyphen;constructed state&period; After this method returns, `formatSpec` will return 0 for all supplied publication types&period;
| xref:BloombergLP/balm/MetricFormat/formatSpec.adoc[`formatSpec`] 
| Return the address of the non&hyphen;modifiable format spec for the specified `publicationType`, or 0 if no format spec has been provided for `publicationType`&period;
| 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`&period; If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by `level`)&period; If `stream` is not valid on entry, this operation has no effect&period;
| xref:BloombergLP/balm/MetricFormat/setFormatSpec.adoc[`setFormatSpec`] 
| Set the format spec for the metric aggregate indicated by the specified `publicationType` to the specified `formatSpec`&period;
| xref:BloombergLP/balm/MetricFormat/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;MetricFormat, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/balm/operator_eq-0c.adoc[BloombergLP::balm::operator&equals;&equals;]`
| Return `true` if the specified `lhs` and `rhs` metric formats have the same value, and `false` otherwise&period; Two metric formats have the same value if they have the same value for `formatSpec` for each of the enumerated publication types&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/operator_not_eq-0e.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` metric formats do not have the same value, and `false` otherwise&period; Two metric formats do not have same value if they differ in their `formatSpec` for any of the enumerated publication types&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
