proxygen
folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap > Struct Template Reference

#include <small_vector.h>

Public Types

typedef SizeType InternalSizeType
 

Public Member Functions

 IntegralSizePolicyBase ()
 

Protected Member Functions

std::size_t doSize () const
 
std::size_t isExtern () const
 
void setExtern (bool b)
 
void setSize (std::size_t sz)
 
void swapSizePolicy (IntegralSizePolicyBase &o)
 

Static Protected Member Functions

static constexpr std::size_t policyMaxSize ()
 

Static Protected Attributes

static bool constexpr kShouldUseHeap = ShouldUseHeap
 

Private Attributes

SizeType size_
 

Static Private Attributes

static SizeType constexpr kExternMask
 

Detailed Description

template<class SizeType, bool ShouldUseHeap>
struct folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >

Definition at line 172 of file small_vector.h.

Member Typedef Documentation

template<class SizeType, bool ShouldUseHeap>
typedef SizeType folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::InternalSizeType

Definition at line 173 of file small_vector.h.

Constructor & Destructor Documentation

template<class SizeType, bool ShouldUseHeap>
folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::IntegralSizePolicyBase ( )
inline

Definition at line 175 of file small_vector.h.

Member Function Documentation

template<class SizeType, bool ShouldUseHeap>
std::size_t folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::doSize ( ) const
inlineprotected

Definition at line 182 of file small_vector.h.

182  {
183  return size_ & ~kExternMask;
184  }
static SizeType constexpr kExternMask
Definition: small_vector.h:211
template<class SizeType, bool ShouldUseHeap>
std::size_t folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::isExtern ( ) const
inlineprotected

Definition at line 186 of file small_vector.h.

186  {
187  return kExternMask & size_;
188  }
static SizeType constexpr kExternMask
Definition: small_vector.h:211
template<class SizeType, bool ShouldUseHeap>
static constexpr std::size_t folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::policyMaxSize ( )
inlinestaticprotected

Definition at line 178 of file small_vector.h.

178  {
179  return SizeType(~kExternMask);
180  }
static SizeType constexpr kExternMask
Definition: small_vector.h:211
template<class SizeType, bool ShouldUseHeap>
void folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::setExtern ( bool  b)
inlineprotected

Definition at line 190 of file small_vector.h.

190  {
191  if (b) {
192  size_ |= kExternMask;
193  } else {
194  size_ &= ~kExternMask;
195  }
196  }
char b
static SizeType constexpr kExternMask
Definition: small_vector.h:211
template<class SizeType, bool ShouldUseHeap>
void folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::setSize ( std::size_t  sz)
inlineprotected

Definition at line 198 of file small_vector.h.

198  {
199  assert(sz <= policyMaxSize());
200  size_ = (kExternMask & size_) | SizeType(sz);
201  }
static constexpr std::size_t policyMaxSize()
Definition: small_vector.h:178
static SizeType constexpr kExternMask
Definition: small_vector.h:211
template<class SizeType, bool ShouldUseHeap>
void folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::swapSizePolicy ( IntegralSizePolicyBase< SizeType, ShouldUseHeap > &  o)
inlineprotected

Definition at line 203 of file small_vector.h.

203  {
204  std::swap(size_, o.size_);
205  }
void swap(small_vector< T, MaxInline, A, B, C > &a, small_vector< T, MaxInline, A, B, C > &b)

Member Data Documentation

template<class SizeType, bool ShouldUseHeap>
SizeType constexpr folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::kExternMask
staticprivate
Initial value:
=
kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1) : 0

Definition at line 211 of file small_vector.h.

template<class SizeType, bool ShouldUseHeap>
bool constexpr folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::kShouldUseHeap = ShouldUseHeap
staticprotected

Definition at line 208 of file small_vector.h.

template<class SizeType, bool ShouldUseHeap>
SizeType folly::detail::IntegralSizePolicyBase< SizeType, ShouldUseHeap >::size_
private

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