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

#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.
 
MetricFormatoperator= (const MetricFormat &rhs)
 
void setFormatSpec (PublicationType::Value publicationType, const MetricFormatSpec &formatSpec)
 
void clearFormatSpecs ()
 
void clearFormatSpec (PublicationType::Value publicationType)
 
const MetricFormatSpecformatSpec (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)
 

Detailed Description

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.

See balm_metricformat

Constructor & Destructor Documentation

◆ MetricFormat() [1/2]

balm::MetricFormat::MetricFormat ( bslma::Allocator basicAllocator = 0)
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.

◆ MetricFormat() [2/2]

balm::MetricFormat::MetricFormat ( const MetricFormat original,
bslma::Allocator basicAllocator = 0 
)
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.

◆ ~MetricFormat()

balm::MetricFormat::~MetricFormat ( )
default

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

balm::MetricFormat::BSLMF_NESTED_TRAIT_DECLARATION ( MetricFormat  ,
bslma::UsesBslmaAllocator   
)

◆ clearFormatSpec()

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.

◆ clearFormatSpecs()

void balm::MetricFormat::clearFormatSpecs ( )
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.

◆ formatSpec()

const MetricFormatSpec * balm::MetricFormat::formatSpec ( PublicationType::Value  publicationType) const
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.

◆ operator=()

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

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

◆ print()

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.

◆ setFormatSpec()

void balm::MetricFormat::setFormatSpec ( PublicationType::Value  publicationType,
const MetricFormatSpec formatSpec 
)
inline

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

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const MetricFormat lhs,
const MetricFormat rhs 
)
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.


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