DataWriterToMemoryDelta< Loggers > Struct Template Reference

CPP API: mio::abm::DataWriterToMemoryDelta< Loggers > Struct Template Reference
mio::abm::DataWriterToMemoryDelta< Loggers > Struct Template Reference

This class writes data retrieved from loggers to memory. More...

#include <common_abm_loggers.h>

Public Types

using Data = std::tuple< std::vector< typename Loggers::Type >... >
 

Static Public Member Functions

template<class Logger >
static void add_record (const typename Logger::Type &t, Data &data)
 This function adds an entry to the data vector. More...
 

Detailed Description

template<class... Loggers>
struct mio::abm::DataWriterToMemoryDelta< Loggers >

This class writes data retrieved from loggers to memory.

It can be used as the Writer template parameter for the History class. This specialization just saves the difference to the last saved data. Suitable when one wants to save huge data with a few changes.

Template Parameters
LoggersThe loggers that are used to log data.

Member Typedef Documentation

◆ Data

template<class... Loggers>
using mio::abm::DataWriterToMemoryDelta< Loggers >::Data = std::tuple<std::vector<typename Loggers::Type>...>

Member Function Documentation

◆ add_record()

template<class... Loggers>
template<class Logger >
static void mio::abm::DataWriterToMemoryDelta< Loggers >::add_record ( const typename Logger::Type &  t,
Data data 
)
inlinestatic

This function adds an entry to the data vector.

Parameters
[in]tThe data from the logger.
[in,out]dataThe data tuple.

The data is only added if it differs from the last entry. For this we use the first entry as a reference for the current position.