proxygen
folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data Union Reference

Public Member Functions

 Data ()
 
value_typebuffer () noexcept
 
value_type const * buffer () const noexcept
 
value_typeheap () noexcept
 
value_type const * heap () const noexcept
 
bool hasCapacity () const
 
InternalSizeType getCapacity () const
 
void setCapacity (InternalSizeType c)
 
void freeHeap ()
 

Public Attributes

PointerType pdata_
 
InlineStorageType storage_
 

Detailed Description

template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
union folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data

Definition at line 1152 of file small_vector.h.

Constructor & Destructor Documentation

template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::Data ( )
inlineexplicit

Definition at line 1153 of file small_vector.h.

1153  {
1154  pdata_.heap_ = nullptr;
1155  }

Member Function Documentation

template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
value_type* folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::buffer ( )
inlinenoexcept

Definition at line 1160 of file small_vector.h.

1160  {
1161  void* vp = &storage_;
1162  return static_cast<value_type*>(vp);
1163  }
InlineStorageType storage_
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
value_type const* folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::buffer ( ) const
inlinenoexcept

Definition at line 1164 of file small_vector.h.

References buffer().

1164  {
1165  return const_cast<Data*>(this)->buffer();
1166  }
value_type * buffer() noexcept
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
void folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::freeHeap ( )
inline

Definition at line 1189 of file small_vector.h.

References FOLLY_SV_PACK_POP, bm::free(), and folly::detail::pointerFlagClear().

1189  {
1190  auto vp = detail::pointerFlagClear(pdata_.heap_);
1191  free(vp);
1192  }
T * pointerFlagClear(T *p)
Definition: small_vector.h:387
void free()
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
InternalSizeType folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::getCapacity ( ) const
inline

Definition at line 1182 of file small_vector.h.

1182  {
1183  return pdata_.getCapacity();
1184  }
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
bool folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::hasCapacity ( ) const
inline

Definition at line 1179 of file small_vector.h.

References folly::detail::pointerFlagGet().

1179  {
1181  }
static bool constexpr kHasInlineCapacity
bool pointerFlagGet(T *p)
Definition: small_vector.h:383
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
value_type* folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::heap ( )
inlinenoexcept

Definition at line 1167 of file small_vector.h.

References folly::detail::pointerFlagClear(), folly::detail::pointerFlagGet(), and folly::detail::shiftPointer().

1167  {
1169  return static_cast<value_type*>(pdata_.heap_);
1170  } else {
1171  return static_cast<value_type*>(detail::shiftPointer(
1173  }
1174  }
T * pointerFlagClear(T *p)
Definition: small_vector.h:387
static bool constexpr kHasInlineCapacity
static size_t constexpr kHeapifyCapacitySize
void * shiftPointer(void *p, size_t sizeBytes)
Definition: small_vector.h:390
bool pointerFlagGet(T *p)
Definition: small_vector.h:383
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
value_type const* folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::heap ( ) const
inlinenoexcept

Definition at line 1175 of file small_vector.h.

1175  {
1176  return const_cast<Data*>(this)->heap();
1177  }
value_type * heap() noexcept
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
void folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::setCapacity ( InternalSizeType  c)
inline

Definition at line 1185 of file small_vector.h.

1185  {
1186  pdata_.setCapacity(c);
1187  }
char c

Member Data Documentation

template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
PointerType folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::pdata_
template<class Value, std::size_t RequestedMaxInline = 1, class PolicyA = void, class PolicyB = void, class PolicyC = void>
InlineStorageType folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::Data::storage_

Definition at line 1158 of file small_vector.h.


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