wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::db::detail::ColumnRows Class Referencefinal

The column-store row storage: one exact-width POD buffer per numeric column, one string vector per string-bearing column, one flags vector per LocString column — implementing both codec interfaces over them. More...

#include <wowlib/db/dyn_table.hpp>

Inheritance diagram for wowlib::db::detail::ColumnRows:

Classes

struct  Facts
 The per-column access facts, derived from the schema at bind. More...

Public Member Functions

 ColumnRows ()=default
 ColumnRows (std::span< const Column > schema)
 Bind the store to schema (whose lifetime the owner guarantees) and derive the per-column access facts.
void clear () override
void reserve (std::size_t n) override
std::size_t add () override
std::size_t size () const override
 One override serves both interfaces (identical signatures).
std::uint32_t idOf (std::size_t record) const override
void setInt (std::size_t record, std::size_t column, std::size_t element, std::int64_t value) override
void setFloat (std::size_t record, std::size_t column, std::size_t element, float value) override
void setString (std::size_t record, std::size_t column, std::size_t element, std::string_view value) override
void cloneWithId (std::size_t src, std::uint32_t newId) override
 Clone record src into a fresh record and set its id column to newId (WDC copy-table materialization).
std::size_t findById (std::uint32_t id) const override
 The first record whose id equals id, or size() when none (copy source lookup).
std::int64_t getInt (std::size_t record, std::size_t column, std::size_t element) const override
std::uint32_t getSlot (std::size_t record, std::size_t column, std::size_t element) const override
std::string_view getString (std::size_t record, std::size_t column, std::size_t element) const override
void eraseRow (std::size_t record)
 Remove row record (all columns' slices).
std::string & stringSlot (std::size_t record, std::size_t column, std::size_t element)
 Mutable string slot access (the public setter's target).
std::uint32_t & flagsSlot (std::size_t record, std::size_t column)
 The LocString flags of record in column.
std::uint32_t flagsSlot (std::size_t record, std::size_t column) const
const Facts & facts (std::size_t column) const
std::span< const std::byte > podBytes (std::size_t column) const
 The whole POD buffer of column column (row-major, exact width) — the zero-copy view the bindings expose as an array.
std::span< const Column > schema () const
Public Member Functions inherited from wowlib::db::RecordSink
virtual ~RecordSink ()=default
Public Member Functions inherited from wowlib::db::RecordSource
virtual ~RecordSource ()=default

Detailed Description

The column-store row storage: one exact-width POD buffer per numeric column, one string vector per string-bearing column, one flags vector per LocString column — implementing both codec interfaces over them.

Not welded; wowlib::db::DynTable is the bound face.

Definition at line 45 of file dyn_table.hpp.

Constructor & Destructor Documentation

◆ ColumnRows() [1/2]

wowlib::db::detail::ColumnRows::ColumnRows ( )
default

References schema().

◆ ColumnRows() [2/2]

Member Function Documentation

◆ add()

◆ clear()

void wowlib::db::detail::ColumnRows::clear ( )
overridevirtual

Implements wowlib::db::RecordSink.

Definition at line 173 of file dyn_table.cpp.

◆ cloneWithId()

void wowlib::db::detail::ColumnRows::cloneWithId ( std::size_t src,
std::uint32_t newId )
overridevirtual

Clone record src into a fresh record and set its id column to newId (WDC copy-table materialization).

Implements wowlib::db::RecordSink.

Definition at line 228 of file dyn_table.cpp.

References add(), wowlib::db::detail::ColumnRows::Facts::elemBytes, wowlib::db::detail::ColumnRows::Facts::hasFlags, wowlib::db::detail::ColumnRows::Facts::podSlots, and wowlib::db::detail::ColumnRows::Facts::strSlots.

◆ eraseRow()

void wowlib::db::detail::ColumnRows::eraseRow ( std::size_t record)

◆ facts()

const Facts & wowlib::db::detail::ColumnRows::facts ( std::size_t column) const
inline
Returns
column column's derived facts.

Definition at line 93 of file dyn_table.hpp.

◆ findById()

std::size_t wowlib::db::detail::ColumnRows::findById ( std::uint32_t id) const
overridevirtual

The first record whose id equals id, or size() when none (copy source lookup).

Implements wowlib::db::RecordSink.

Definition at line 244 of file dyn_table.cpp.

References idOf().

◆ flagsSlot() [1/2]

std::uint32_t & wowlib::db::detail::ColumnRows::flagsSlot ( std::size_t record,
std::size_t column )

The LocString flags of record in column.

Definition at line 301 of file dyn_table.cpp.

◆ flagsSlot() [2/2]

std::uint32_t wowlib::db::detail::ColumnRows::flagsSlot ( std::size_t record,
std::size_t column ) const

Definition at line 305 of file dyn_table.cpp.

◆ getInt()

std::int64_t wowlib::db::detail::ColumnRows::getInt ( std::size_t record,
std::size_t column,
std::size_t element ) const
overridevirtual

◆ getSlot()

std::uint32_t wowlib::db::detail::ColumnRows::getSlot ( std::size_t record,
std::size_t column,
std::size_t element ) const
overridevirtual

◆ getString()

std::string_view wowlib::db::detail::ColumnRows::getString ( std::size_t record,
std::size_t column,
std::size_t element ) const
overridevirtual

◆ idOf()

std::uint32_t wowlib::db::detail::ColumnRows::idOf ( std::size_t record) const
overridevirtual

Implements wowlib::db::RecordSink.

Definition at line 204 of file dyn_table.cpp.

Referenced by findById().

◆ podBytes()

std::span< const std::byte > wowlib::db::detail::ColumnRows::podBytes ( std::size_t column) const
inline

The whole POD buffer of column column (row-major, exact width) — the zero-copy view the bindings expose as an array.

Parameters
columna numeric/float column.
Returns
the raw bytes (size() * podSlots * elemBytes).

Definition at line 99 of file dyn_table.hpp.

◆ reserve()

◆ schema()

std::span< const Column > wowlib::db::detail::ColumnRows::schema ( ) const
inline
Returns
the bound schema.

Definition at line 104 of file dyn_table.hpp.

Referenced by ColumnRows(), and ColumnRows().

◆ setFloat()

void wowlib::db::detail::ColumnRows::setFloat ( std::size_t record,
std::size_t column,
std::size_t element,
float value )
overridevirtual

Implements wowlib::db::RecordSink.

Definition at line 219 of file dyn_table.cpp.

References wowlib::db::detail::F32.

◆ setInt()

void wowlib::db::detail::ColumnRows::setInt ( std::size_t record,
std::size_t column,
std::size_t element,
std::int64_t value )
overridevirtual

◆ setString()

void wowlib::db::detail::ColumnRows::setString ( std::size_t record,
std::size_t column,
std::size_t element,
std::string_view value )
overridevirtual

Implements wowlib::db::RecordSink.

Definition at line 223 of file dyn_table.cpp.

References wowlib::db::detail::ColumnRows::Facts::strSlots.

◆ size()

std::size_t wowlib::db::detail::ColumnRows::size ( ) const
overridevirtual

One override serves both interfaces (identical signatures).

Implements wowlib::db::RecordSink.

Definition at line 202 of file dyn_table.cpp.

◆ stringSlot()

std::string & wowlib::db::detail::ColumnRows::stringSlot ( std::size_t record,
std::size_t column,
std::size_t element )

Mutable string slot access (the public setter's target).

Definition at line 297 of file dyn_table.cpp.


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