8#ifndef INCLUDED_BALM_METRICFORMAT
9#define INCLUDED_BALM_METRICFORMAT
12BSLS_IDENT(
"$Id: balm_metricformat.h,v 1.8 2008/04/16 20:00:49 hversche Exp $")
157#include <balscm_version.h>
165#include <bsl_iosfwd.h>
166#include <bsl_vector.h>
167#include <bsl_cstring.h>
188 const char *d_format;
192 static const char *k_DEFAULT_FORMAT;
256 const char *
format()
const;
267 bsl::ostream&
print(bsl::ostream& stream,
269 int spacesPerLevel = -1)
const;
396 bsl::ostream&
print(bsl::ostream& stream,
398 int spacesPerLevel = 4)
const;
435, d_format(k_DEFAULT_FORMAT)
449: d_scale(original.d_scale)
450, d_format(original.d_format)
459 d_scale = rhs.d_scale;
460 d_format = rhs.d_format;
493 const MetricFormatSpec& rhs)
495 return lhs.scale() == rhs.scale()
496 && 0 == bsl::strcmp(lhs.format(), rhs.format());
501 const MetricFormatSpec& rhs)
503 return !(lhs == rhs);
508 const MetricFormatSpec& rhs)
510 return rhs.print(stream, 0, -1);
521: d_formatSpecs(basicAllocator)
528: d_formatSpecs(original.d_formatSpecs, basicAllocator)
537 d_formatSpecs = rhs.d_formatSpecs;
545 if (d_formatSpecs.empty()) {
548 d_formatSpecs[(int)publicationType].makeValue(
formatSpec);
554 d_formatSpecs.clear();
562 if (d_formatSpecs.empty()) {
574 const MetricFormat& rhs)
576 return lhs.d_formatSpecs == rhs.d_formatSpecs;
581 const MetricFormat& rhs)
583 return !(lhs == rhs);
587bsl::ostream&
balm::operator<<(bsl::ostream& stream,
const MetricFormat& rhs)
589 return rhs.print(stream, 0, -1);
Definition bdlb_nullablevalue.h:257
bool isNull() const BSLS_KEYWORD_NOEXCEPT
Return true if this object is null, and false otherwise.
Definition bdlb_nullablevalue.h:1779
TYPE & value()
Definition bdlb_nullablevalue.h:1742
Definition bslstl_vector.h:1025
Definition bslma_allocator.h:457
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition balm_bdlmmetricsadapter.h:141
bool operator==(const IntegerMetric &lhs, const IntegerMetric &rhs)
bsl::ostream & operator<<(bsl::ostream &stream, const Category &rhs)
bool operator!=(const IntegerMetric &lhs, const IntegerMetric &rhs)
@ k_LENGTH
Definition balm_publicationtype.h:126
Value
Definition balm_publicationtype.h:81
Definition bslma_usesbslmaallocator.h:343