Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::ScopedCounter Class Reference

#include <runtime-profile.h>

Collaboration diagram for impala::ScopedCounter:

Public Member Functions

 ScopedCounter (RuntimeProfile::Counter *counter, int64_t val)
 
 ~ScopedCounter ()
 Increment the counter when object is destroyed. More...
 

Private Member Functions

 ScopedCounter (const ScopedCounter &counter)
 Disable copy constructor and assignment. More...
 
ScopedCounteroperator= (const ScopedCounter &counter)
 

Private Attributes

int64_t val_
 
RuntimeProfile::Countercounter_
 

Detailed Description

Utility class to update the counter at object construction and destruction. When the object is constructed, decrement the counter by val. When the object goes out of scope, increment the counter by val.

Definition at line 678 of file runtime-profile.h.

Constructor & Destructor Documentation

impala::ScopedCounter::ScopedCounter ( RuntimeProfile::Counter counter,
int64_t  val 
)
inline

Definition at line 680 of file runtime-profile.h.

References impala::RuntimeProfile::Counter::Add(), counter_, and val_.

impala::ScopedCounter::~ScopedCounter ( )
inline

Increment the counter when object is destroyed.

Definition at line 688 of file runtime-profile.h.

References impala::RuntimeProfile::Counter::Add(), counter_, and val_.

impala::ScopedCounter::ScopedCounter ( const ScopedCounter counter)
private

Disable copy constructor and assignment.

Member Function Documentation

ScopedCounter& impala::ScopedCounter::operator= ( const ScopedCounter counter)
private

Member Data Documentation

RuntimeProfile::Counter* impala::ScopedCounter::counter_
private

Definition at line 698 of file runtime-profile.h.

Referenced by ScopedCounter(), and ~ScopedCounter().

int64_t impala::ScopedCounter::val_
private

Definition at line 697 of file runtime-profile.h.

Referenced by ScopedCounter(), and ~ScopedCounter().


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