Go to the documentation of this file.
15 #ifndef GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
16 #define GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
36 template <
typename T,
size_t kChunkSize>
49 template <
class Iterator>
64 other.first_ =
nullptr;
65 other.append_ =
nullptr;
81 template <
typename...
Args>
84 p->Init(std::forward<Args>(
args)...);
94 while (chunk->next !=
append_) {
108 while (chunk !=
nullptr && chunk->count != 0) {
109 for (
size_t i = 0;
i < chunk->count;
i++) {
148 return !(*
this == other);
184 return !(*
this == other);
194 return ForwardIterator(
first_, 0);
196 ForwardIterator
end() {
return ForwardIterator(
nullptr, 0); }
198 ConstForwardIterator
begin()
const {
200 return ConstForwardIterator(
first_, 0);
202 ConstForwardIterator
end()
const {
return ConstForwardIterator(
nullptr, 0); }
205 ConstForwardIterator
cend()
const {
return end(); }
210 for (
const Chunk* chunk =
first_; chunk !=
nullptr; chunk = chunk->
next) {
220 if (
it ==
end())
return;
221 Chunk* chunk =
it.chunk_;
222 for (
size_t i =
it.n_; i < chunk->
count;
i++) {
223 chunk->data[
i].Destroy();
225 chunk->count =
it.n_;
227 while ((chunk = chunk->next) !=
nullptr) {
228 for (
size_t i = 0;
i < chunk->count;
i++) {
257 #endif // GRPC_CORE_LIB_GPRPP_CHUNKED_VECTOR_H
bool operator==(const ForwardIterator &other) const
T * EmplaceBack(Args &&... args)
void SetEnd(ForwardIterator it)
ConstForwardIterator cbegin() const
ConstForwardIterator & operator++(int)
std::ptrdiff_t difference_type
ConstForwardIterator begin() const
bool operator!=(const ForwardIterator &other) const
ManualConstructor< T > data[kChunkSize]
ManualConstructor< T > * AppendSlot()
static constexpr size_t kChunkSize
ConstForwardIterator & operator++()
ConstForwardIterator end() const
#define T(upbtypeconst, upbtype, ctype, default_value)
void Swap(ChunkedVector *other)
ChunkedVector(Arena *arena)
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
bool operator!=(const ConstForwardIterator &other) const
ChunkedVector(ChunkedVector &&other) noexcept
const T * operator->() const
ChunkedVector & operator=(const ChunkedVector &other)
ForwardIterator & operator++(int)
ConstForwardIterator(const Chunk *chunk, size_t n)
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
bool operator==(const ConstForwardIterator &other) const
ChunkedVector(const ChunkedVector &other)
ForwardIterator(Chunk *chunk, size_t n)
std::forward_iterator_tag iterator_category
const T & operator*() const
ForwardIterator & operator++()
std::forward_iterator_tag iterator_category
ConstForwardIterator cend() const
ChunkedVector(Arena *arena, Iterator begin, Iterator end)
ChunkedVector & operator=(ChunkedVector &&other) noexcept
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:54