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

#include <balm_defaultmetricsmanager.h>

Public Member Functions

 DefaultMetricsManagerScopedGuard (bsl::ostream &stream, bslma::Allocator *basicAllocator=0)
 
 DefaultMetricsManagerScopedGuard (bslma::Allocator *basicAllocator=0)
 
 ~DefaultMetricsManagerScopedGuard ()
 
MetricsManagerinstance () const
 

Detailed Description

This class implements a scoped guard that, on construction, creates the default instance of the metrics manager, and, on destruction, destroys that instance. Note that the behavior is undefined if the default instance of the metrics manager is created before creating this guard, or if the default instance is externally destroyed before destroying this guard.

See balm_defaultmetricsmanager

Constructor & Destructor Documentation

◆ DefaultMetricsManagerScopedGuard() [1/2]

balm::DefaultMetricsManagerScopedGuard::DefaultMetricsManagerScopedGuard ( bsl::ostream &  stream,
bslma::Allocator basicAllocator = 0 
)
inline

Create a scoped guard which invokes DefaultMetricsManager::create() to create a default metrics manager instance that is configured with a stream publisher that will publish collected metrics to the specified stream. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed global allocator is used. The behavior is undefined unless DefaultMetricsManager::instance() is 0 prior to creating the guard.

◆ DefaultMetricsManagerScopedGuard() [2/2]

balm::DefaultMetricsManagerScopedGuard::DefaultMetricsManagerScopedGuard ( bslma::Allocator basicAllocator = 0)
inline

Create a scoped guard which invokes the DefaultMetricsManager::create method. Optionally specify a basicAllocator used to obtain memory. If basicAllocator is 0, the currently installed global allocator is used. The behavior is undefined unless 0 == DefaultMetricsManager::instance() prior to creating the guard. Note that the default metrics manager instance is not configured with a publisher; clients must create a Publisher object and add it to the default metrics manager in order to publish metrics.

◆ ~DefaultMetricsManagerScopedGuard()

balm::DefaultMetricsManagerScopedGuard::~DefaultMetricsManagerScopedGuard ( )
inline

Destroy this scoped guard which invokes DefaultMetricsManager::destroy(). The behavior is undefined if the default instance of the metrics manager is externally destroyed prior to this destructor being invoked.

Member Function Documentation

◆ instance()

MetricsManager * balm::DefaultMetricsManagerScopedGuard::instance ( ) const
inline

Return the address of the MetricsManager object managed by this scoped guard. The behavior is undefined if the default instance of the metrics manager is externally destroyed, or if the returned address is retained after this scoped guard is destroyed.


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