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

#include <balm_metricid.h>

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (MetricId, bsl::is_trivially_copyable)
 
 MetricId ()
 Create an invalid metric id.
 
 MetricId (const MetricDescription *metricDescription)
 
 MetricId (const MetricId &original)=default
 
 ~MetricId ()=default
 Destroy this object.
 
MetricIdoperator= (const MetricId &rhs)=default
 
const MetricDescription *& description ()
 
const MetricDescription *const & description () const
 
bool isValid () const
 
const Categorycategory () const
 
const char * categoryName () const
 
const char * metricName () const
 
bsl::ostream & print (bsl::ostream &stream) const
 

Detailed Description

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.

See balm_metricid

Constructor & Destructor Documentation

◆ MetricId() [1/3]

balm::MetricId::MetricId ( )
inline

◆ MetricId() [2/3]

balm::MetricId::MetricId ( const MetricDescription metricDescription)
inline

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.

◆ MetricId() [3/3]

balm::MetricId::MetricId ( const MetricId original)
default

Create a metric id with the value of the specified 'original' metric id. The behavior is undefined unless the 'description()' of 'original' is 0, or the indicated metric description object remains valid for the lifetime of this metric id object.

◆ ~MetricId()

balm::MetricId::~MetricId ( )
default

Member Function Documentation

◆ BSLMF_NESTED_TRAIT_DECLARATION()

balm::MetricId::BSLMF_NESTED_TRAIT_DECLARATION ( MetricId  ,
bsl::is_trivially_copyable   
)

◆ category()

const Category * balm::MetricId::category ( ) const
inline

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

const char * balm::MetricId::categoryName ( ) const
inline

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() [1/2]

const MetricDescription *& balm::MetricId::description ( )
inline

Return a reference to the modifiable address of the held non-modifiable MetricDescription, which defines the value of this metric id.

◆ description() [2/2]

const MetricDescription *const & balm::MetricId::description ( ) const
inline

Return a reference to the non-modifiable address of the held non-modifiable MetricDescription, which defines the value of this metric id.

◆ isValid()

bool balm::MetricId::isValid ( ) const
inline

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

const char * balm::MetricId::metricName ( ) const
inline

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

◆ operator=()

MetricId & balm::MetricId::operator= ( const MetricId rhs)
default

Assign this metric id the value of the specified 'rhs' metric id object, and return a reference to this object. The behavior is undefined unless the 'description()' of 'rhs' is 0, or the metric-description object remains valid for the lifetime of this metric-id object.

◆ print()

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.


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