SmartTableDeadSecondaries.h

The columns a second sort level can't move a row with, worked out only when something asks.

Source/SmartTables/Public/SmartTableDeadSecondaries.h

Columns a second sort level could not reorder, and whether that answer still fits the rows.

Worked out when asked for, not at sort time. Filling it costs a pass over the presented rows, and the only things that read it are a Shift held header and an open menu, so most tables pay nothing.

Struct
FSmartTableDeadSecondaries
Members
7

Public functions 5

MarkStale
void MarkStale()

Says the answer may no longer fit the rows. Every input it depends on, and where the table marks it:

  • the presented order and the row set, ties being groups in it. HandlePresentationChanged.
  • the values, which decide what ties. The same place, through bCellsStale.
  • the declared columns, the candidates. SetColumns.
  • bAllowDeadSecondarySort, which decides if it is worked out at all. Its setter.
  • the model, whose swap arrives as a presentation change.

One row changing is left out. It can move the answer, but marking on it left a live feed paying a whole-table pass per tick. The gated readers only draw, and SortBySecondaryColumn works it out again.

IsStale
bool IsStale() const
Contains
bool Contains( FName ColumnId ) const

Whether a second sort level on this column could reorder nothing, as of the last Recompute.

Recompute
void Recompute( const FSmartTableSortSpec & Spec, int32 NumPresentedRows, TArrayView< const FName > Candidates, TFunctionRef< FSmartTableSortKey( int32 PresentedRow, FName ColumnId ) > ReadKey )

Works the answer out again from the rows as they stand, and clears the stale mark.

With nothing sorted no column is dead. A Shift click then becomes the primary sort, and turning it down would stop the wrong click.

Clear
void Clear()

No column dead, and nothing stale. The answer for a table with no model.

Private variables 2

Columns
TSet< FName > Columns
bStale
bool bStale = true

Next: SmartTableColumnLayout.h