51#ifndef OPENMESH_SR_BINARY_HH
52#define OPENMESH_SR_BINARY_HH
57#include <OpenMesh/Core/System/config.h>
77 const static size_t UnknownSize(
size_t(-1));
96template <
typename T,
typename =
void >
struct binary
104 static size_t size_of(
void) {
return UnknownSize; }
106 static size_t size_of(
const value_type&) {
return UnknownSize; }
118 std::ostringstream msg;
119 msg <<
"Type not supported: " <<
typeid(value_type).name();
120 throw std::logic_error(msg.str());
130 std::ostringstream msg;
131 msg <<
"Type not supported: " <<
typeid(value_type).name();
132 throw std::logic_error(msg.str());
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
The struct defines how to store and restore the type T.
Definition: SR_binary.hh:97
static size_t restore(std::istream &, value_type &, bool=false, bool=true)
Restore a value of T and return the number of bytes read.
Definition: SR_binary.hh:125
static const bool is_streamable
Can we store T? Set this to true in your specialization.
Definition: SR_binary.hh:101
static size_t store(std::ostream &, const value_type &, bool=false, bool=true)
Store a value of T and return the number of bytes written.
Definition: SR_binary.hh:113
static std::string type_identifier(void)
A string that identifies the type of T.
Definition: SR_binary.hh:109
static size_t size_of(void)
What's the size of T? If it depends on the actual value (e.g. for vectors) return UnknownSize.
Definition: SR_binary.hh:104
static size_t size_of(const value_type &)
What't the size of a specific value of type T.
Definition: SR_binary.hh:106