Class PacketTableConfig#

Inheritance Relationships#

Base Type#

Class Documentation#

class PacketTableConfig : public Karana::Core::LockingBase#

Define the columns and associated update functions for a PacketTable. The PacketTable is the table that stores data in the H5 log file.

Public Functions

PacketTableConfig(std::string_view name)#

PacketTableConfig constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.

Parameters:

name – Name of the table. A / will be interpreted as a new group. Groups will be added as needed.

~PacketTableConfig()#

Destroy packet table config.

template<class T>
inline void addData(std::string_view name, const T &f, int vector_size, bool as_scalars = false)#

Add data to the table via function.

Parameters:
  • name – The name of the column in the table.

  • f – The function that produces the data (dynamic vector). This vector must always be the same size.

  • vector_size – The size of the vector that the function produces. This vector must always be the same size.

  • as_scalars – Rather than using one column for the vector, use multiple. This logs each vector component as a scalar. The column names will be appended with a _X where “X” is an integer that corresponds with the index in the vector.

template<class T>
inline void addData(std::string_view name, const T &f, int matrix_rows, int matrix_cols, bool as_scalars = false)#

Add data to the table via function.

Parameters:
  • name – The name of the column in the table.

  • f – The function that produces the data (dynamic matrix). This matrix must always be the same size.

  • matrix_rows – The number of rows in the matrix that the function produces. This matrix must always be the same size.

  • matrix_cols – The number of columns in the matrix that the function produces. This matrix must always be the same size.

  • as_scalars – Rather than using one column for the matrix, use multiple. This logs each matrix component as a scalar. The column names will be appended with a _X_Y where “X” and “Y” are integers that correspond with the row and index of the element in the matrix.

template<class T, class R = typename std::invoke_result<T>::type>
inline void addData(std::string_view name, const T &f, bool as_scalars = false)#

Add data to the table via function.

Parameters:
  • name – The name of the column in the table.

  • f – The function that produces the data.

  • as_scalars – Rather than using one column for the vector, use multiple. This logs each vector component as a scalar. The column names will be appended with a _X where “X” is an integer that corresponds with the index in the vector.

template<class T, class R = typename std::invoke_result<T>::type>
inline void addData(std::string_view name, const T &f, bool as_scalars = false)

Add data to the table via function.

Parameters:
  • name – The name of the column in the table.

  • f – The function that produces the data.

  • as_scalars – Rather than using one column for the matrix, use multiple. This logs each matrix component as a scalar. The column names will be appended with a _X_Y where “X” and “Y” are integers that correspond with the row and index of the element in the matrix.

template<class T, class R = typename std::invoke_result<T>::type>
inline void addData(std::string_view name, const T &f)#

Add data to the table via function.

Parameters:
  • name – The name of the column in the table.

  • f – The function that produces the data.

void fillBuf()#

Fill the buffer by calling all the functions.

Public Static Functions

static kc::ks_ptr<PacketTableConfig> create(std::string_view name)#

Create a packet table config.

Parameters:

name – Name of the table. A / will be interpreted as a new group. Groups will be added as needed.

Returns:

A ks_ptr to the newly created instance of PacketTableConfig.

Protected Functions

virtual void _makeCurrent()#

Create the data type and buffer for the data. This can only be done once.

virtual void _makeStale()#

This should never be called. If it is, then there is an issue.