proxygen
TestRefCount Class Reference

Public Member Functions

 ~TestRefCount () noexcept
 
int64_t operator++ () noexcept
 
int64_t operator-- () noexcept
 
int64_t operator* () noexcept
 
void useGlobal ()
 

Static Public Member Functions

template<typename Container >
static void useGlobal (const Container &)
 

Private Attributes

std::atomic< int64_tcount_ {1}
 

Detailed Description

Definition at line 242 of file ReadMostlySharedPtrTest.cpp.

Constructor & Destructor Documentation

TestRefCount::~TestRefCount ( )
inlinenoexcept

Definition at line 244 of file ReadMostlySharedPtrTest.cpp.

244  {
245  DCHECK_EQ(count_.load(), 0);
246  }
std::atomic< int64_t > count_

Member Function Documentation

int64_t TestRefCount::operator* ( )
inlinenoexcept

Definition at line 260 of file ReadMostlySharedPtrTest.cpp.

260  {
261  return count_.load();
262  }
std::atomic< int64_t > count_
int64_t TestRefCount::operator++ ( )
inlinenoexcept

Definition at line 248 of file ReadMostlySharedPtrTest.cpp.

248  {
249  auto ret = ++count_;
250  DCHECK_GT(ret, 0);
251  return ret;
252  }
std::atomic< int64_t > count_
int64_t TestRefCount::operator-- ( )
inlinenoexcept

Definition at line 254 of file ReadMostlySharedPtrTest.cpp.

254  {
255  auto ret = --count_;
256  DCHECK_GE(ret, 0);
257  return ret;
258  }
std::atomic< int64_t > count_
void TestRefCount::useGlobal ( )
inline

Definition at line 264 of file ReadMostlySharedPtrTest.cpp.

References useGlobalCalls.

264  {
265  ++useGlobalCalls;
266  }
size_t useGlobalCalls
template<typename Container >
static void TestRefCount::useGlobal ( const Container &  )
inlinestatic

Definition at line 269 of file ReadMostlySharedPtrTest.cpp.

References useGlobalCalls.

269  {
270  ++useGlobalCalls;
271  }
size_t useGlobalCalls

Member Data Documentation

std::atomic<int64_t> TestRefCount::count_ {1}
private

Definition at line 274 of file ReadMostlySharedPtrTest.cpp.


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