Public Member Functions | List of all members
mootBinIO::Item< T > Class Template Reference

Binary item I/O template class, used for binary HMM model files.

Inheritance diagram for mootBinIO::Item< T >:
Inheritance graph
[legend]

Public Member Functions

bool load (mootio::mistream *is, T &x) const
 
bool save (mootio::mostream *os, const T &x) const
 
bool load_n (mootio::mistream *is, T *&x, size_t &n) const
 
bool save_n (mootio::mostream *os, const T *x, size_t n) const
 

Member Function Documentation

◆ load()

template<class T>
bool mootBinIO::Item< T >::load ( mootio::mistream is,
T &  x 
) const
inline

◆ save()

template<class T>
bool mootBinIO::Item< T >::save ( mootio::mostream os,
const T &  x 
) const
inline

◆ load_n()

template<class T>
bool mootBinIO::Item< T >::load_n ( mootio::mistream is,
T *&  x,
size_t &  n 
) const
inline

Load a C-array of items. 'n' should hold the currently allocated length of 'x'. If the saved length is > n, 'x' will be re-allocated. The new size of the array will be stored in 'n' at completion.

Referenced by mootBinIO::Item< char * >::load(), and mootBinIO::Item< string >::load().

◆ save_n()

template<class T>
bool mootBinIO::Item< T >::save_n ( mootio::mostream os,
const T *  x,
size_t  n 
) const
inline

Save a C-array of items. 'n' should hold the number of items in 'x', it will be written first.

Referenced by mootBinIO::Item< char * >::save(), and mootBinIO::Item< string >::save().


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