Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

balm::DefaultMetricsManagerScopedGuard Class Reference

#include <balm_defaultmetricsmanager.h>

List of all members.

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 Component balm_defaultmetricsmanager


Constructor & Destructor Documentation

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

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.

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

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.

balm::DefaultMetricsManagerScopedGuard::~DefaultMetricsManagerScopedGuard (  ) 

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

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

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: