Quick Links: |
#include <balm_metricid.h>
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (MetricId, bsl::is_trivially_copyable) | |
MetricId () | |
MetricId (const MetricDescription *metricDescription) | |
const MetricDescription *& | description () |
const MetricDescription *const & | description () const |
bool | isValid () const |
const Category * | category () const |
const char * | categoryName () const |
const char * | metricName () const |
bsl::ostream & | print (bsl::ostream &stream) const |
This class defines an in-core value-semantic type used to identify a metric. A MetricId
object's value is the address of a non-modifiable MetricDescription
object. In addition, a MetricDescription
object provides auxiliary methods, category
, categoryName
, and name
, that enable access to the properties of the held MetricDescription
. Two MetricId
objects have the same value if the values of their respective MetricDescription
object addresses are the same.
balm::MetricId::MetricId | ( | ) |
Create an invalid metric id.
balm::MetricId::MetricId | ( | const MetricDescription * | metricDescription | ) |
Create a metric id whose value is the specified metricDescription
address. The behavior is undefined unless metricDescription
is 0, or the indicated metric description object remains valid for the lifetime of this metric id object.
balm::MetricId::BSLMF_NESTED_TRAIT_DECLARATION | ( | MetricId | , | |
bsl::is_trivially_copyable | ||||
) |
const MetricDescription*& balm::MetricId::description | ( | ) |
Return a reference to the modifiable address of the held non-modifiable MetricDescription
, which defines the value of this metric id.
const MetricDescription* const& balm::MetricId::description | ( | ) | const |
Return a reference to the non-modifiable address of the held non-modifiable MetricDescription
, which defines the value of this metric id.
bool balm::MetricId::isValid | ( | ) | const |
Return true
if this metric id object contains the address of a valid MetricDescription
object, and false otherwise
. Note that this method is logically equivalent to 0 != description()
.
const Category* balm::MetricId::category | ( | ) | const |
Return the address of the non-modifiable Category
object identifying the category with which this metric id is associated. The behavior is undefined unless isValid()
is true
. Note that this method is logically equivalent to description()->category()
.
const char* balm::MetricId::categoryName | ( | ) | const |
Return the address of the non-modifiable name for the category with which this metric id is associated. The behavior is undefined unless isValid()
is true
. Note that this method is logically equivalent to description()->category()->name()
.
const char* balm::MetricId::metricName | ( | ) | const |
Return the address of the non-modifiable name of this metric id. The behavior is undefined unless isValid()
is true
. Note that this method is logically equivalent to description()->name()
.
bsl::ostream& balm::MetricId::print | ( | bsl::ostream & | stream | ) | const |
Print this metric id to the specified output stream
in some single-line human-readable form, and return a reference to the modifiable stream
.