chrono::ChCheckpointWriter Class Reference

Description

Writer for a block of checkpoint data.

A physics item, FEA element or FEA node writes its internal state (data not stored in the system state vectors) to a writer; the checkpoint database stores the resulting block in its own format. The same data must be read back, in the same order, with a ChCheckpointReader. See the developer manual on the physics item lifecycle.

#include <ChCheckpointBlock.h>

Public Member Functions

void Write (double value)
 Write a number.
 
template<typename T , typename std::enable_if< std::is_integral< T >::value, int >::type = 0>
void Write (T value)
 Write an integral number (stored exactly if its magnitude is below 2^53).
 
void Write (const ChVector3d &v)
 Write a 3D vector.
 
void Write (const ChQuaterniond &q)
 Write a quaternion.
 
void Write (const std::vector< double > &v)
 Write a vector of numbers (its size, then its elements).
 
template<typename Derived >
void Write (const Eigen::MatrixBase< Derived > &m)
 Write an Eigen matrix or vector (its dimensions, then its elements in column-major order).
 
void WriteBytes (const std::vector< std::uint8_t > &bytes)
 Write an opaque sequence of bytes.
 
void Write (const ChCheckpointWriter &block)
 Write a nested block.
 
void WriteIndexedBlocks (size_t n, const std::function< void(size_t, ChCheckpointWriter &)> &save)
 Write, for each index in [0,n), the block produced by the provided function, tagged with that index. More...
 
bool IsEmpty () const
 Return true if nothing was written.
 
const std::vector< ChCheckpointEntry > & GetEntries () const
 Access the entries written so far.
 

Member Function Documentation

◆ WriteIndexedBlocks()

void chrono::ChCheckpointWriter::WriteIndexedBlocks ( size_t  n,
const std::function< void(size_t, ChCheckpointWriter &)> &  save 
)

Write, for each index in [0,n), the block produced by the provided function, tagged with that index.

Empty blocks are skipped. Read back with ChCheckpointReader::ReadIndexedBlocks.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/input_output/ChCheckpointBlock.h
  • /builds/uwsbel/chrono/src/chrono/input_output/ChCheckpointBlock.cpp