proxygen
SimpleDigest< MergeSize > Class Template Reference

Public Member Functions

 SimpleDigest (size_t sz)
 
SimpleDigest merge (Range< const double * > r) const
 
std::vector< double > getValues () const
 
bool empty () const
 
 SimpleDigest (size_t sz)
 
SimpleDigest merge (Range< const double * > r) const
 
int64_t getSize () const
 

Static Public Member Functions

static SimpleDigest merge (Range< const SimpleDigest * > r)
 
static SimpleDigest merge (Range< const SimpleDigest * > r)
 

Private Attributes

std::vector< double > values_
 
int64_t sz_
 

Detailed Description

template<size_t MergeSize>
class SimpleDigest< MergeSize >

Definition at line 39 of file BufferedStatTest.cpp.

Constructor & Destructor Documentation

template<size_t MergeSize>
SimpleDigest< MergeSize >::SimpleDigest ( size_t  sz)
inlineexplicit

Definition at line 41 of file BufferedStatTest.cpp.

References EXPECT_EQ, and kDigestSize.

41  {
43  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const size_t kDigestSize
template<size_t MergeSize>
SimpleDigest< MergeSize >::SimpleDigest ( size_t  sz)
inlineexplicit

Definition at line 32 of file DigestBuilderTest.cpp.

32 : sz_(sz) {}

Member Function Documentation

template<size_t MergeSize>
bool SimpleDigest< MergeSize >::empty ( ) const
inline

Definition at line 69 of file BufferedStatTest.cpp.

69  {
70  return values_.empty();
71  }
std::vector< double > values_
template<size_t MergeSize>
int64_t SimpleDigest< MergeSize >::getSize ( ) const
inline

Definition at line 47 of file DigestBuilderTest.cpp.

47  {
48  return sz_;
49  }
template<size_t MergeSize>
std::vector<double> SimpleDigest< MergeSize >::getValues ( ) const
inline

Definition at line 65 of file BufferedStatTest.cpp.

65  {
66  return values_;
67  }
std::vector< double > values_
template<size_t MergeSize>
SimpleDigest SimpleDigest< MergeSize >::merge ( Range< const double * >  r) const
inline

Definition at line 34 of file DigestBuilderTest.cpp.

References EXPECT_EQ, EXPECT_GE, i, and folly::Range< Iter >::size().

34  {
35  EXPECT_EQ(MergeSize, r.size());
36  for (size_t i = 0; i < MergeSize; ++i) {
37  EXPECT_GE(MergeSize, r[i]);
38  }
39  return *this;
40  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
constexpr size_type size() const
Definition: Range.h:431
#define EXPECT_GE(val1, val2)
Definition: gtest.h:1932
template<size_t MergeSize>
static SimpleDigest SimpleDigest< MergeSize >::merge ( Range< const SimpleDigest< MergeSize > * >  r)
inlinestatic

Definition at line 42 of file DigestBuilderTest.cpp.

References folly::Range< Iter >::begin(), EXPECT_EQ, and folly::Range< Iter >::size().

42  {
43  EXPECT_EQ(1, r.size());
44  return *r.begin();
45  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
constexpr size_type size() const
Definition: Range.h:431
constexpr Iter begin() const
Definition: Range.h:452
template<size_t MergeSize>
SimpleDigest SimpleDigest< MergeSize >::merge ( Range< const double * >  r) const
inline

Definition at line 45 of file BufferedStatTest.cpp.

References folly::Range< Iter >::begin(), folly::Range< Iter >::end(), and SimpleDigest< MergeSize >::values_.

45  {
46  SimpleDigest digest(100);
47 
48  digest.values_ = values_;
49  for (auto it = r.begin(); it != r.end(); ++it) {
50  digest.values_.push_back(*it);
51  }
52  return digest;
53  }
std::vector< double > values_
constexpr Iter end() const
Definition: Range.h:455
constexpr Iter begin() const
Definition: Range.h:452
template<size_t MergeSize>
static SimpleDigest SimpleDigest< MergeSize >::merge ( Range< const SimpleDigest< MergeSize > * >  r)
inlinestatic

Definition at line 55 of file BufferedStatTest.cpp.

References folly::Range< Iter >::begin(), folly::Range< Iter >::end(), folly::value(), and SimpleDigest< MergeSize >::values_.

55  {
56  SimpleDigest digest(100);
57  for (auto it = r.begin(); it != r.end(); ++it) {
58  for (auto value : it->values_) {
59  digest.values_.push_back(value);
60  }
61  }
62  return digest;
63  }
static const char *const value
Definition: Conv.cpp:50
constexpr Iter end() const
Definition: Range.h:455
constexpr Iter begin() const
Definition: Range.h:452

Member Data Documentation

template<size_t MergeSize>
int64_t SimpleDigest< MergeSize >::sz_
private

Definition at line 52 of file DigestBuilderTest.cpp.

template<size_t MergeSize>
std::vector<double> SimpleDigest< MergeSize >::values_
private

Definition at line 74 of file BufferedStatTest.cpp.

Referenced by SimpleDigest< MergeSize >::merge().


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