morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::table::KeyColumn Struct Reference

One column's keys, built once and shared, immutable, between jobs. More...

#include <sort.hpp>

Public Member Functions

bool usesComparator () const noexcept
 Whether this column orders Custom cells through a comparator.
void set (std::size_t row, Cell const &cell, ColumnInfo const &info, Services const &services)
 Rebuilds the key of one row from cell.

Static Public Member Functions

static KeyColumn forColumn (ColumnInfo const &info, Services const &services, std::size_t rows)
 An empty key column for info, sized for rows rows.

Public Attributes

ColumnKind kind = ColumnKind::Text
 The column's kind.
std::vector< CellState > states
 The state of each row's cell.
std::vector< std::int64_t > ints
 Integer keys.
std::vector< math::Rational > exact
 Exact keys.
std::vector< double > reals
 Floating-point keys.
std::vector< std::string > text
 Collation keys.
std::vector< std::string > folded
 Primary-strength folds, which text filters match.
std::vector< std::string > raw
 The text as the source gave it, for case-sensitive filters.
std::vector< Cell > cells
 Cells of a Custom column with a comparator.
CellComparator comparator
 The comparator of a Custom column, or empty.

Detailed Description

One column's keys, built once and shared, immutable, between jobs.

Exactly one of the typed arrays is filled, chosen by the column's kind: ints for Integer, Key, Date, DateTime and Bool; exact for Decimal and Quantity; reals for Number; text, folded and raw for Text; cells for a Custom column with a known comparator, and text for one without (ordered by display text).

Definition at line 178 of file sort.hpp.

Member Function Documentation

◆ usesComparator()

bool morph::table::KeyColumn::usesComparator ( ) const
inlinenodiscardnoexcept

Whether this column orders Custom cells through a comparator.

Returns
true when comparator is set.

Definition at line 202 of file sort.hpp.

◆ forColumn()

KeyColumn morph::table::KeyColumn::forColumn ( ColumnInfo const & info,
Services const & services,
std::size_t rows )
inlinestaticnodiscard

An empty key column for info, sized for rows rows.

Parameters
infoThe column.
servicesWhere a Custom column's comparator is looked up.
rowsRow count.
Returns
The column, every cell Empty until built.

Definition at line 209 of file sort.hpp.

◆ set()

void morph::table::KeyColumn::set ( std::size_t row,
Cell const & cell,
ColumnInfo const & info,
Services const & services )
inline

Rebuilds the key of one row from cell.

Parameters
rowRow index.
cellThe row's cell.
infoThe column.
servicesCollator and date parser; a null member means its default.

Definition at line 253 of file sort.hpp.

Member Data Documentation

◆ kind

ColumnKind morph::table::KeyColumn::kind = ColumnKind::Text

The column's kind.

Definition at line 180 of file sort.hpp.

◆ states

std::vector<CellState> morph::table::KeyColumn::states

The state of each row's cell.

Definition at line 182 of file sort.hpp.

◆ ints

std::vector<std::int64_t> morph::table::KeyColumn::ints

Integer keys.

Definition at line 184 of file sort.hpp.

◆ exact

std::vector<math::Rational> morph::table::KeyColumn::exact

Exact keys.

Definition at line 186 of file sort.hpp.

◆ reals

std::vector<double> morph::table::KeyColumn::reals

Floating-point keys.

Definition at line 188 of file sort.hpp.

◆ text

std::vector<std::string> morph::table::KeyColumn::text

Collation keys.

Definition at line 190 of file sort.hpp.

◆ folded

std::vector<std::string> morph::table::KeyColumn::folded

Primary-strength folds, which text filters match.

Definition at line 192 of file sort.hpp.

◆ raw

std::vector<std::string> morph::table::KeyColumn::raw

The text as the source gave it, for case-sensitive filters.

Definition at line 194 of file sort.hpp.

◆ cells

std::vector<Cell> morph::table::KeyColumn::cells

Cells of a Custom column with a comparator.

Definition at line 196 of file sort.hpp.

◆ comparator

CellComparator morph::table::KeyColumn::comparator

The comparator of a Custom column, or empty.

Definition at line 198 of file sort.hpp.


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