proxygen
folly::f14::Counts Struct Reference

#include <F14TestUtil.h>

Public Member Functions

 Counts (uint64_t copConstr=0, uint64_t movConstr=0, uint64_t copConv=0, uint64_t movConv=0, uint64_t copAssign=0, uint64_t movAssign=0, uint64_t def=0, uint64_t destr=0)
 
int64_t liveCount () const
 
uint64_t dist (Counts const &rhs) const
 
bool operator== (Counts const &rhs) const
 
bool operator!= (Counts const &rhs) const
 

Public Attributes

uint64_t copyConstruct {0}
 
uint64_t moveConstruct {0}
 
uint64_t copyConvert {0}
 
uint64_t moveConvert {0}
 
uint64_t copyAssign {0}
 
uint64_t moveAssign {0}
 
uint64_t defaultConstruct {0}
 
uint64_t destroyed {0}
 

Detailed Description

Definition at line 122 of file F14TestUtil.h.

Constructor & Destructor Documentation

folly::f14::Counts::Counts ( uint64_t  copConstr = 0,
uint64_t  movConstr = 0,
uint64_t  copConv = 0,
uint64_t  movConv = 0,
uint64_t  copAssign = 0,
uint64_t  movAssign = 0,
uint64_t  def = 0,
uint64_t  destr = 0 
)
inlineexplicit

Definition at line 132 of file F14TestUtil.h.

141  : copyConstruct{copConstr},
142  moveConstruct{movConstr},
143  copyConvert{copConv},
144  moveConvert{movConv},
145  copyAssign{copAssign},
146  moveAssign{movAssign},
147  defaultConstruct{def},
148  destroyed{destr} {}
uint64_t moveConstruct
Definition: F14TestUtil.h:124
uint64_t copyConstruct
Definition: F14TestUtil.h:123
uint64_t defaultConstruct
Definition: F14TestUtil.h:129
uint64_t copyConvert
Definition: F14TestUtil.h:125
uint64_t moveConvert
Definition: F14TestUtil.h:126

Member Function Documentation

uint64_t folly::f14::Counts::dist ( Counts const &  rhs) const
inline

Definition at line 156 of file F14TestUtil.h.

References copyAssign, copyConstruct, copyConvert, defaultConstruct, moveAssign, moveConstruct, moveConvert, uint64_t, and x.

156  {
157  auto d = [](uint64_t x, uint64_t y) { return (x - y) * (x - y); };
158  return d(copyConstruct, rhs.copyConstruct) +
159  d(moveConstruct, rhs.moveConstruct) + d(copyConvert, rhs.copyConvert) +
160  d(moveConvert, rhs.moveConvert) + d(copyAssign, rhs.copyAssign) +
161  d(moveAssign, rhs.moveAssign) +
162  d(defaultConstruct, rhs.defaultConstruct);
163  }
const int x
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
uint64_t moveConstruct
Definition: F14TestUtil.h:124
uint64_t copyConstruct
Definition: F14TestUtil.h:123
uint64_t defaultConstruct
Definition: F14TestUtil.h:129
uint64_t copyConvert
Definition: F14TestUtil.h:125
uint64_t moveConvert
Definition: F14TestUtil.h:126
Definition: InvokeTest.cpp:65
int64_t folly::f14::Counts::liveCount ( ) const
inline

Definition at line 150 of file F14TestUtil.h.

150  {
153  }
uint64_t moveConstruct
Definition: F14TestUtil.h:124
uint64_t copyConstruct
Definition: F14TestUtil.h:123
uint64_t defaultConstruct
Definition: F14TestUtil.h:129
uint64_t copyConvert
Definition: F14TestUtil.h:125
uint64_t moveConvert
Definition: F14TestUtil.h:126
bool folly::f14::Counts::operator!= ( Counts const &  rhs) const
inline

Definition at line 168 of file F14TestUtil.h.

References folly::detail::rhs.

168  {
169  return !(*this == rhs);
170  }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool folly::f14::Counts::operator== ( Counts const &  rhs) const
inline

Definition at line 165 of file F14TestUtil.h.

References destroyed, and dist.

165  {
166  return dist(rhs) == 0 && destroyed == rhs.destroyed;
167  }
uint64_t dist(Counts const &rhs) const
Definition: F14TestUtil.h:156
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649

Member Data Documentation

uint64_t folly::f14::Counts::copyAssign {0}
uint64_t folly::f14::Counts::copyConstruct {0}

Definition at line 123 of file F14TestUtil.h.

Referenced by dist(), folly::f14::operator<<(), and folly::f14::Tracked< 0 >::Tracked().

uint64_t folly::f14::Counts::copyConvert {0}

Definition at line 125 of file F14TestUtil.h.

Referenced by dist(), folly::f14::operator<<(), and folly::f14::Tracked< 0 >::Tracked().

uint64_t folly::f14::Counts::defaultConstruct {0}

Definition at line 129 of file F14TestUtil.h.

Referenced by dist(), folly::f14::operator<<(), and folly::f14::Tracked< 0 >::Tracked().

uint64_t folly::f14::Counts::destroyed {0}
uint64_t folly::f14::Counts::moveAssign {0}
uint64_t folly::f14::Counts::moveConstruct {0}

Definition at line 124 of file F14TestUtil.h.

Referenced by dist(), folly::f14::operator<<(), and folly::f14::Tracked< 0 >::Tracked().

uint64_t folly::f14::Counts::moveConvert {0}

Definition at line 126 of file F14TestUtil.h.

Referenced by dist(), folly::f14::operator<<(), and folly::f14::Tracked< 0 >::Tracked().


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