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.

Synopsis

Declared in <balm_metricid.h>

class MetricId;

Member Functions

Name

Description

MetricId [constructor]

Constructors

category

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().

categoryName

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().

description

description overloads

isValid

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().

metricName

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().

print

Print this metric id to the specified output stream in some single‐line human‐readable form, and return a reference to the modifiable stream.

operator BloombergLP::bslmf::NestedTraitDeclaration<MetricId, is_trivially_copyable>

Declare that this type is trivially copyable.

Non-Member Functions

Name

Description

operator!=

Return true if the specified lhs and rhs metric ids do not have the same value and false otherwise. Two metric ids do not have same value if they refer to different MetricDescription object addresses, or exactly one address is 0.

operator<

Return true if the specified lhs metric id is less than (ordered before) the specified rhs metric id, and return false otherwise'. The lhs is considered less if the (unsigned) address of the contained MetricDescription object is numerically less than the rhs description. Note that this function does not provide any form of alphabetic ordering, and is logically equivalent to the expression lhs.description() < rhs.description().

operator==

Return true if the specified lhs and rhs metric ids have the same value and false otherwise. Two metric ids have the same value if they each hold the address of the same MetricDescription object, or both addresses are 0.

Created with MrDocs