Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
wmtk::history::detail::Reader Class Reference

Reads the bytes of a history, [p, end). what and name say what they are in messages, "<what>: <name> is ...": the kind of history, and a file or the bytes given. A read past the end throws "is truncated", a count that could not fit in what is left "is corrupt". More...

#include <BinaryIO.hpp>

Public Member Functions

 Reader (const uint8_t *p, const uint8_t *end, std::string what, std::string name)
 
 Reader (const std::vector< uint8_t > &in, std::string name)
 All of in, the bytes of a surface's or curves' history.
 
uint64_t remaining () const
 The bytes not read yet, and where they start.
 
const uint8_t * at () const
 
uint64_t count (const uint64_t min_bytes=1)
 
void corrupt () const
 
template<typename T >
T get ()
 
uint8_t byte ()
 
uint64_t varint ()
 
Eigen::Vector3d position ()
 
void bytes (char *p, const size_t n)
 
std::string string (const uint64_t n)
 
const std::string & name () const
 

Private Attributes

const uint8_t * m_p
 
const uint8_t * m_end
 
std::string m_what
 
std::string m_name
 

Detailed Description

Reads the bytes of a history, [p, end). what and name say what they are in messages, "<what>: <name> is ...": the kind of history, and a file or the bytes given. A read past the end throws "is truncated", a count that could not fit in what is left "is corrupt".

Member Function Documentation

◆ count()

uint64_t wmtk::history::detail::Reader::count ( const uint64_t  min_bytes = 1)
inline

A count of items of at least min_bytes each, which the rest of the bytes must hold: a damaged count cannot make the reader allocate more than the bytes could fill.


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