proxygen
folly::detail::GroupVarintBase< T > Class Template Reference

#include <GroupVarintDetail.h>

Public Types

enum  : uint32_t { kGroupSize = Traits::kGroupSize }
 
enum  : uint32_t { kMaxSize = kHeaderSize + sizeof(type) * kGroupSize }
 
typedef T type
 

Static Public Member Functions

static size_t maxSize (size_t n)
 
static size_t totalSize (const T *p, size_t n)
 

Protected Types

enum  : uint32_t { kHeaderSize = Traits::kHeaderSize }
 
typedef GroupVarintTraits< TTraits
 

Private Types

enum  { kFullGroupSize = kHeaderSize + kGroupSize * sizeof(type) }
 
typedef GroupVarint< TDerived
 

Detailed Description

template<typename T>
class folly::detail::GroupVarintBase< T >

Definition at line 49 of file GroupVarintDetail.h.

Member Typedef Documentation

template<typename T >
typedef GroupVarint<T> folly::detail::GroupVarintBase< T >::Derived
private

Definition at line 96 of file GroupVarintDetail.h.

template<typename T >
typedef GroupVarintTraits<T> folly::detail::GroupVarintBase< T >::Traits
protected

Definition at line 51 of file GroupVarintDetail.h.

template<typename T >
typedef T folly::detail::GroupVarintBase< T >::type

Definition at line 55 of file GroupVarintDetail.h.

Member Enumeration Documentation

template<typename T >
anonymous enum : uint32_t
protected
Enumerator
kHeaderSize 

Definition at line 52 of file GroupVarintDetail.h.

template<typename T >
anonymous enum : uint32_t

Number of integers encoded / decoded in one pass.

Enumerator
kGroupSize 

Definition at line 60 of file GroupVarintDetail.h.

Member Function Documentation

template<typename T >
static size_t folly::detail::GroupVarintBase< T >::maxSize ( size_t  n)
inlinestatic

Maximum size for n values.

Definition at line 70 of file GroupVarintDetail.h.

References type.

70  {
71  // Full groups
72  size_t total = (n / kGroupSize) * kFullGroupSize;
73  // Incomplete last group, if any
74  n %= kGroupSize;
75  if (n) {
76  total += kHeaderSize + n * sizeof(type);
77  }
78  return total;
79  }
template<typename T >
static size_t folly::detail::GroupVarintBase< T >::totalSize ( const T p,
size_t  n 
)
inlinestatic

Size of n values starting at p.

Definition at line 84 of file GroupVarintDetail.h.

References folly::size().

84  {
85  size_t size = 0;
86  for (; n >= kGroupSize; n -= kGroupSize, p += kGroupSize) {
87  size += Derived::size(p);
88  }
89  if (n) {
90  size += Derived::partialSize(p, n);
91  }
92  return size;
93  }
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45

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