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

#include <balm_metricsample.h>

Public Types

typedef const MetricRecordconst_iterator
 

Public Member Functions

 MetricSampleGroup ()
 
 MetricSampleGroup (const MetricRecord *records, int numRecords, const bsls::TimeInterval &elapsedTime)
 
 MetricSampleGroup (const MetricSampleGroup &original)
 
 ~MetricSampleGroup ()=default
 Destroy this object.
 
MetricSampleGroupoperator= (const MetricSampleGroup &rhs)
 
void setElapsedTime (const bsls::TimeInterval &elapsedTime)
 
void setRecords (const MetricRecord *records, int numRecords)
 
const MetricRecordrecords () const
 
int numRecords () const
 
const bsls::TimeIntervalelapsedTime () const
 
const_iterator begin () const
 
const_iterator end () const
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 

Detailed Description

This class provides an in-core value-semantic representation of a group of metric record values. This class contains the address of an array of (externally managed) MetricRecord objects, the number of records in that array, and an elapsed time value (used to indicate the time span over which the metric values were aggregated).

See balm_metricsample

Member Typedef Documentation

◆ const_iterator

A const_iterator is an alias for an iterator over the non-modifiable records referenced in a MetricSampleGroup.

Constructor & Destructor Documentation

◆ MetricSampleGroup() [1/3]

balm::MetricSampleGroup::MetricSampleGroup ( )
inline

Create an empty sample group. By default, the records() address is 0, numRecords() is 0, and the elapsedTime() is the default- constructed bsls::TimeInterval.

◆ MetricSampleGroup() [2/3]

balm::MetricSampleGroup::MetricSampleGroup ( const MetricRecord records,
int  numRecords,
const bsls::TimeInterval elapsedTime 
)
inline

Create a sample group containing the specified sequence of records of specified length numRecords, recorded over a period whose duration is the specified elapsedTime. The behavior is undefined unless 0 <= numRecords and records points to a contiguous sequence of (at least) numRecords metric records. Note that the contents of records is not copied and the supplied array must remain valid for the productive lifetime of this object or until the records are set to a different sequence by calling the setRecords manipulator.

◆ MetricSampleGroup() [3/3]

balm::MetricSampleGroup::MetricSampleGroup ( const MetricSampleGroup original)
inline

Create a sample group having the same (in-core) value as the specified original sample group.

◆ ~MetricSampleGroup()

balm::MetricSampleGroup::~MetricSampleGroup ( )
default

Member Function Documentation

◆ begin()

MetricSampleGroup::const_iterator balm::MetricSampleGroup::begin ( ) const
inline

Return an iterator positioned at the beginning of the sequence of MetricRecord objects referenced by this object.

◆ elapsedTime()

const bsls::TimeInterval & balm::MetricSampleGroup::elapsedTime ( ) const
inline

Return a reference to the non-modifiable elapsed time interval over which this object's metric records were aggregated.

◆ end()

MetricSampleGroup::const_iterator balm::MetricSampleGroup::end ( ) const
inline

Return an iterator positioned one past the final MetricRecord object in the sequence of records referenced by this object.

◆ numRecords()

int balm::MetricSampleGroup::numRecords ( ) const
inline

Return the number of records (referenced to by records()) in this object.

◆ operator=()

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

Assign to this sample group the value of the specified rhs sample group, and return a reference to this modifiable sample group. Note that only the pointer to the MetricRecord array and the length are copied, and not the records themselves.

◆ print()

bsl::ostream & balm::MetricSampleGroup::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.

◆ records()

const MetricRecord * balm::MetricSampleGroup::records ( ) const
inline

Return the address of the contiguous sequence of non-modifiable records of length numRecords().

◆ setElapsedTime()

void balm::MetricSampleGroup::setElapsedTime ( const bsls::TimeInterval elapsedTime)
inline

Set the elapsed time (used to indicate the time span over which this object's metric records were aggregated) to the specified elapsedTime.

◆ setRecords()

void balm::MetricSampleGroup::setRecords ( const MetricRecord records,
int  numRecords 
)
inline

Set the sequence of records referred to by this sample group to the specified sequence of records of specified length numRecords. The behavior is undefined unless 0 <= numRecords, and records refers to a contiguous sequence of (at least) numRecords. Note that the contents of records is not copied and the supplied array must remain valid for the productive lifetime of this object or until the records are set to a different sequence by calling the setRecords manipulator.


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