Vince's CSV Parser
Loading...
Searching...
No Matches
csv::internals::memory::RawCSVFieldList Class Reference

A class used for efficiently storing RawCSVField objects and expanding as necessary. More...

#include <raw_csv_field_list.hpp>

Public Member Functions

 RawCSVFieldList (size_t single_buffer_capacity=(size_t)(internals::PAGE_SIZE/sizeof(RawCSVField)))
 Construct a RawCSVFieldList which allocates blocks of a certain size.
 
 RawCSVFieldList (const RawCSVFieldList &other)=delete
 
 RawCSVFieldList (RawCSVFieldList &&other) noexcept
 
template<class... Args>
void emplace_back (Args &&... args)
 
size_t size () const noexcept
 
void reserve_for_source_size (size_t source_size)
 
RawCSVField & operator[] (size_t n) const
 Access a field by its index.
 

Detailed Description

A class used for efficiently storing RawCSVField objects and expanding as necessary.

Implementation
Stores fields in fixed-size page-aligned chunks via a vector of unique_ptr<RawCSVField[]> handles:
  • This design provides better cache locality when accessing sequential fields in a row as well as much lower memory allocation overhead.
  • Fixed-size blocks allow direct division/modulo lookup; this intentionally avoids the variable-block metadata needed by quote realization storage.
Thread Safety
Cross-thread visibility for field contents is provided by the records queue mutex in ThreadSafeDeque. The fixed arena publishes size/block state with atomics so readers can safely resolve already-emitted rows while the parser appends later fields from the same RawCSVData.

Definition at line 36 of file raw_csv_field_list.hpp.

Constructor & Destructor Documentation

◆ RawCSVFieldList() [1/2]

csv::internals::memory::RawCSVFieldList::RawCSVFieldList ( size_t  single_buffer_capacity = (size_t)(internals::PAGE_SIZE / sizeof(RawCSVField)))
inline

Construct a RawCSVFieldList which allocates blocks of a certain size.

Definition at line 39 of file raw_csv_field_list.hpp.

◆ RawCSVFieldList() [2/2]

csv::internals::memory::RawCSVFieldList::RawCSVFieldList ( RawCSVFieldList &&  other)
inlinenoexcept

Definition at line 51 of file raw_csv_field_list.hpp.

Member Function Documentation

◆ emplace_back()

template<class... Args>
void csv::internals::memory::RawCSVFieldList::emplace_back ( Args &&...  args)
inline

Definition at line 61 of file raw_csv_field_list.hpp.

◆ operator[]()

RawCSVField & csv::internals::memory::RawCSVFieldList::operator[] ( size_t  n) const
inline

Access a field by its index.

This allows CSVRow objects to access fields without knowing internal implementation details of RawCSVFieldList.

Definition at line 89 of file raw_csv_field_list.hpp.

◆ reserve_for_source_size()

void csv::internals::memory::RawCSVFieldList::reserve_for_source_size ( size_t  source_size)
inline

Definition at line 78 of file raw_csv_field_list.hpp.

◆ size()

size_t csv::internals::memory::RawCSVFieldList::size ( ) const
inlinenoexcept

Definition at line 74 of file raw_csv_field_list.hpp.


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