proxygen
|
#include <Padded.h>
Public Types | |
typedef Container::value_type | Node |
typedef Node::value_type | value_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef Iterator< typename Container::iterator > | iterator |
typedef Iterator< typename Container::const_iterator > | const_iterator |
typedef const_iterator::difference_type | difference_type |
typedef Container::size_type | size_type |
Public Member Functions | |
Adaptor () | |
Adaptor (Container c, size_t lastCount=Node::kElementCount) | |
Adaptor (size_t n, const value_type &value=value_type()) | |
Adaptor (const Adaptor &)=default | |
Adaptor & | operator= (const Adaptor &)=default |
Adaptor (Adaptor &&other) noexcept | |
Adaptor & | operator= (Adaptor &&other) |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_iterator | begin () const |
const_iterator | end () const |
iterator | begin () |
iterator | end () |
void | swap (Adaptor &other) |
bool | empty () const |
size_type | size () const |
size_type | max_size () const |
const value_type & | front () const |
value_type & | front () |
const value_type & | back () const |
value_type & | back () |
template<typename... Args> | |
void | emplace_back (Args &&...args) |
void | push_back (value_type x) |
void | pop_back () |
void | clear () |
void | reserve (size_type n) |
size_type | capacity () const |
const value_type & | operator[] (size_type idx) const |
value_type & | operator[] (size_type idx) |
std::pair< Container, size_t > | move () |
std::pair< const Container &, size_t > | peek () const |
void | padToFullNode (const value_type &padValue) |
Static Public Attributes | |
static constexpr size_t | kElementsPerNode = Node::kElementCount |
Private Member Functions | |
value_type * | allocate_back () |
Static Private Member Functions | |
static Node | fullNode (const value_type &value) |
Private Attributes | |
Container | c_ |
size_t | lastCount_ |
Adaptor around a STL sequence container.
Converts a sequence of Node into a sequence of its underlying elements (with enough functionality to make it useful, although it's not fully compatible with the STL containre requiremenets, see below).
Provides iterators (of the same category as those of the underlying container), size(), front(), back(), push_back(), pop_back(), and const / non-const versions of operator[] (if the underlying container supports them). Does not provide push_front() / pop_front() or arbitrary insert / emplace / erase. Also provides reserve() / capacity() if supported by the underlying container.
Yes, it's called Adaptor, not Adapter, as that's the name used by the STL and by boost. Deal with it.
Internally, we hold a container of Node and the number of elements in the last block. We don't keep empty blocks, so the number of elements in the last block is always between 1 and Node::kElementCount (inclusive). (this is true if the container is empty as well to make push_back() simpler, see the implementation of the size() method for details).
typedef Iterator<typename Container::const_iterator> folly::padded::Adaptor< Container >::const_iterator |
typedef const value_type& folly::padded::Adaptor< Container >::const_reference |
typedef const_iterator::difference_type folly::padded::Adaptor< Container >::difference_type |
typedef Iterator<typename Container::iterator> folly::padded::Adaptor< Container >::iterator |
typedef Container::value_type folly::padded::Adaptor< Container >::Node |
typedef value_type& folly::padded::Adaptor< Container >::reference |
typedef Container::size_type folly::padded::Adaptor< Container >::size_type |
typedef Node::value_type folly::padded::Adaptor< Container >::value_type |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
Definition at line 388 of file Padded.h.
|
default |
|
inlinenoexcept |
|
inlineprivate |
Definition at line 541 of file Padded.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 426 of file Padded.h.
|
inline |
|
inline |
Definition at line 410 of file Padded.h.
|
inline |
Definition at line 413 of file Padded.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 429 of file Padded.h.
|
inline |
|
inline |
|
inlinestaticprivate |
Definition at line 549 of file Padded.h.
|
inline |
|
inline |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 479 of file Padded.h.
|
inline |
|
inline |
|
inline |
Definition at line 436 of file Padded.h.
|
private |
Definition at line 554 of file Padded.h.
Referenced by folly::padded::Adaptor< IntNodeVec >::swap().
|
static |
|
private |
Definition at line 555 of file Padded.h.
Referenced by folly::padded::Adaptor< IntNodeVec >::swap().