|
BDE 4.14.0 Production release
|
#include <balm_metricformat.h>
Public Member Functions | |
| BSLMF_NESTED_TRAIT_DECLARATION (MetricFormat, bslma::UsesBslmaAllocator) | |
| MetricFormat (bslma::Allocator *basicAllocator=0) | |
| MetricFormat (const MetricFormat &original, bslma::Allocator *basicAllocator=0) | |
| ~MetricFormat ()=default | |
| Destroy this object. | |
| MetricFormat & | operator= (const MetricFormat &rhs) |
| void | setFormatSpec (PublicationType::Value publicationType, const MetricFormatSpec &formatSpec) |
| void | clearFormatSpecs () |
| void | clearFormatSpec (PublicationType::Value publicationType) |
| const MetricFormatSpec * | formatSpec (PublicationType::Value publicationType) const |
| bsl::ostream & | print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const |
Friends | |
| bool | operator== (const MetricFormat &lhs, const MetricFormat &rhs) |
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.
|
inline |
Create an empty metric format object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used. Note that formatSpec will return 0 for all supplied publication types.
|
inline |
Create a metric format object having the same value as the specified original format. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
|
default |
| balm::MetricFormat::BSLMF_NESTED_TRAIT_DECLARATION | ( | MetricFormat | , |
| bslma::UsesBslmaAllocator | |||
| ) |
| void balm::MetricFormat::clearFormatSpec | ( | PublicationType::Value | publicationType | ) |
Remove the format spec for the specified publicationType from this metric format object. After this methods returns, formatSpec(publicationType) will return 0.
|
inline |
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.
|
inline |
Return the address of the non-modifiable format spec for the specified publicationType, or 0 if no format spec has been provided for publicationType.
|
inline |
Assign to this metric format object the value of the specified rhs metric format, and return a reference to this modifiable metric format.
| bsl::ostream & balm::MetricFormat::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.
|
inline |
Set the format spec for the metric aggregate indicated by the specified publicationType to the specified formatSpec.
|
friend |
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.