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));
84 std::ostringstream msg; \
85 msg << "Type not supported: " << typeid(value_type).name(); \
86 throw std::logic_error(msg.str())
101 template <
typename T,
typename =
void >
struct binary
103 typedef T value_type;
109 static size_t size_of(
void) {
return UnknownSize; }
111 static size_t size_of(
const value_type&) {
return UnknownSize; }
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:102
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:126
static const bool is_streamable
Can we store T? Set this to true in your specialization.
Definition: SR_binary.hh:106
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:118
static std::string type_identifier(void)
A string that identifies the type of T.
Definition: SR_binary.hh:114
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:109
static size_t size_of(const value_type &)
What't the size of a specific value of type T.
Definition: SR_binary.hh:111