KiCad PCB EDA Suite
Loading...
Searching...
No Matches
api_generated_table_utils.h File Reference
#include <algorithm>
#include <cstdint>
#include <type_traits>
#include <api/api_utils.h>
#include <base_units.h>
#include <pcb_generated_table.h>
#include <google/protobuf/any.pb.h>

Go to the source code of this file.

Functions

template<typename MSG>
void PackGeneratedTable (const PCB_GENERATED_TABLE &aTable, MSG &aMsg)
 Pack what every generated table shares into its message.
 
template<typename MSG>
bool UnpackGeneratedTable (const MSG &aMsg, PCB_GENERATED_TABLE &aTable)
 The reverse of PackGeneratedTable.
 

Function Documentation

◆ PackGeneratedTable()

template<typename MSG>
void PackGeneratedTable ( const PCB_GENERATED_TABLE & aTable,
MSG & aMsg )

Pack what every generated table shares into its message.

Each generated table has its own message, so this relies on every one of them naming these fields the same way: table, columns (id, heading, align, width), units, precision and row_keys. Column ids and alignments are offset by one, leaving zero as the unset value.

Definition at line 42 of file api_generated_table_utils.h.

References PCB_GENERATED_TABLE::Columns(), PCB_GENERATED_TABLE::GetPrecision(), PCB_GENERATED_TABLE::GetUnits(), ID, INCH, MILS, MM, kiapi::common::PackDistance(), and PCB_GENERATED_TABLE::RowKeys().

Referenced by PCB_DRILL_CHART::Serialize().

◆ UnpackGeneratedTable()

template<typename MSG>
bool UnpackGeneratedTable ( const MSG & aMsg,
PCB_GENERATED_TABLE & aTable )