STORMM Source Documentation
Loading...
Searching...
No Matches
stormm::diskutil::BinaryFileKey Class Reference

The table of contents keeps a list of arrays and specific values as well as text-based strings describing them. The strings can come from Hybrid objects' labels, for example, but can also accept arbitrary character strings. More...

#include <binary_encoding.h>

Public Member Functions

template<typename T>
void addScalar (T parm, const std::string &description_in=std::string(""))
 Add a critical scalar constant to the table of contents. Every added array gets its own sizing constants (size of the element, number of elements), and the number of arrays also gets automatic inclusion. Constants like the time step size, simulation time constant, or fixed-precision bit counts are also critical to interpreting a binary file. Only data scalar types may be included in the table of contents, as they will be decomposed into a program-specific bit string describing their attributes.
 
template<typename T2>
void addTuple2 (T2 parm, const std::string &description_in=std::string(""))
 Add a two-component tuple to the table of contents. Descriptions of input parameters follow from addScalar(), above.
 
template<typename T3>
void addTuple3 (T3 parm, const std::string &description_in=std::string(""))
 Add a three-component tuple to the table of contents. Descriptions of input parameters follow from addScalar(), above.
 
template<typename T4>
void addTuple4 (T4 parm, const std::string &description_in=std::string(""))
 Add a four-component tuple to the table of contents. Descriptions of input parameters follow from addScalar(), above.
 
 BinaryFileKey (const std::string &description_in=std::string(""))
 The constructor can take one or more arrays as well as specific objects, for convenience.
 
template<typename T>
 BinaryFileKey (const T *content, size_t length, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
template<typename T>
 BinaryFileKey (const std::vector< T > *content, const std::string &description_in=std::string(""))
 
template<typename T>
 BinaryFileKey (const std::vector< T > &content, const std::string &description_in=std::string(""))
 
template<typename T>
 BinaryFileKey (const Hybrid< T > *content, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
template<typename T>
 BinaryFileKey (const Hybrid< T > &content, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
 BinaryFileKey (const CoordinateFrame *cf, const std::string &description_in=std::string(default_cf_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
 BinaryFileKey (const CoordinateFrame &cf, const std::string &description_in=std::string(default_cf_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
 BinaryFileKey (const PhaseSpace *ps, const std::string &description_in=std::string(default_ps_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
 BinaryFileKey (const PhaseSpace &ps, const std::string &description_in=std::string(default_ps_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
template<typename T>
 BinaryFileKey (const CoordinateSeries< T > *content, const std::string &description_in=std::string(default_cs_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
template<typename T>
 BinaryFileKey (const CoordinateSeries< T > &content, const std::string &description_in=std::string(default_cs_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
 BinaryFileKey (const PhaseSpaceSynthesis *content, const std::string &description_in=std::string(default_polyps_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
 BinaryFileKey (const PhaseSpaceSynthesis &content, const std::string &description_in=std::string(default_polyps_descriptor), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
void addArray (const void *vptr, size_t length, size_t ct_vptr, bool repeating_in, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 Add a new array to the current table of contents. The array will be appended by default, but specifying a position for the array among the list is possible. Overloading and descriptions of input parameters follow from the constructor, above, in addition to:
 
template<typename T>
void addArray (const T *content, size_t length, bool repeating_in, const std::string &description_in, HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
template<typename T>
void addArray (const std::vector< T > *content, bool repeating_in, const std::string &description_in=std::string(""))
 
template<typename T>
void addArray (const std::vector< T > &content, bool repeating_in, const std::string &description_in=std::string(""))
 
template<typename T>
void addArray (const Hybrid< T > *content, bool repeating_in, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 
template<typename T>
void addArray (const Hybrid< T > &content, bool repeating_in, const std::string &description_in=std::string(""), HybridTargetLevel tier_in=HybridTargetLevel::HOST)
 

Detailed Description

The table of contents keeps a list of arrays and specific values as well as text-based strings describing them. The strings can come from Hybrid objects' labels, for example, but can also accept arbitrary character strings.

Constructor & Destructor Documentation

◆ BinaryFileKey()

stormm::diskutil::BinaryFileKey::BinaryFileKey ( const std::string & description_in = std::string(""))

The constructor can take one or more arrays as well as specific objects, for convenience.

Overloaded:

  • Prepare a blank table of contents with just a descriptor for the overall file and a notion of the origin of the information
  • Prepare a table of contents for a single array. More can be appended later, modifying the table of contents, but the binary file must be written in order after the table of contents has been decided.
  • Provide a container (Hybrid objects or Standard Template Library vectors) or a C-style arrays with a trusted length
  • Prepare a table of contents for specific objects.
Parameters
contentAn array or STORMM object with data to write to the binary file
lengthTrusted length of content, if provided as a C-style array
descThe description of the array initializing the table of contents

Member Function Documentation

◆ addArray()

void stormm::diskutil::BinaryFileKey::addArray ( const void * vptr,
size_t length,
size_t ct_vptr,
bool repeating_in,
const std::string & description_in = std::string(""),
HybridTargetLevel tier_in = HybridTargetLevel::HOST )

Add a new array to the current table of contents. The array will be appended by default, but specifying a position for the array among the list is possible. Overloading and descriptions of input parameters follow from the constructor, above, in addition to:

Parameters
vptrThe void-casted pointer of whatever data array in its raw form. The pointer may address memory on the CPU host or GPU device.

◆ addScalar()

template<typename T>
void stormm::diskutil::BinaryFileKey::addScalar ( T parm,
const std::string & description_in = std::string("") )

Add a critical scalar constant to the table of contents. Every added array gets its own sizing constants (size of the element, number of elements), and the number of arrays also gets automatic inclusion. Constants like the time step size, simulation time constant, or fixed-precision bit counts are also critical to interpreting a binary file. Only data scalar types may be included in the table of contents, as they will be decomposed into a program-specific bit string describing their attributes.

Parameters
parmThe parameter to include in the table of contents
descThe description of the parameter

The documentation for this class was generated from the following files: