#include <OpenMesh/Core/System/config.h>#include <iterator>#include <string>#include <limits>#include <vector>#include <stdexcept>#include <numeric>#include <OpenMesh/Core/Geometry/VectorT.hh>#include <OpenMesh/Core/Mesh/Status.hh>#include <OpenMesh/Core/IO/SR_types.hh>#include <OpenMesh/Core/IO/SR_rbo.hh>#include <OpenMesh/Core/IO/SR_binary.hh>#include <OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl>

Go to the source code of this file.
| #define BINARY_VECTOR | ( | T | ) |
Definition at line 3 of file SR_binary_spec.hh.
| #define SIMPLE_BINARY | ( | T | ) |
template <> struct binary< T > { \ typedef T value_type; \ static const bool is_streamable = true; \ static size_t size_of(const value_type&) { return sizeof(value_type); } \ static size_t size_of(void) { return sizeof(value_type); } \ static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ if (_swap) reverse_byte_order(tmp); \ /* Convert unsigned long to unsigned int for compatibility reasons */ \ unsigned int t1 = static_cast<unsigned int>(tmp); \ _os.write( (const char*)&t1, sizeof(unsigned int) ); \ return _os.good() ? sizeof(unsigned int) : 0; \ } \ \ static size_t restore( std::istream& _is, value_type& _val, \ bool _swap=false) { \ unsigned int t1; \ _is.read( (char*)&t1, sizeof(unsigned int) ); \ _val = t1; \ if (_swap) reverse_byte_order(_val); \ return _is.good() ? sizeof(unsigned int) : 0; \ } \ }
Definition at line 136 of file SR_binary_spec.hh.
| #define SIMPLE_BINARY | ( | T | ) |
template <> struct binary< T > { \ typedef T value_type; \ static const bool is_streamable = true; \ static size_t size_of(const value_type&) { return sizeof(value_type); } \ static size_t size_of(void) { return sizeof(value_type); } \ static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ if (_swap) reverse_byte_order(tmp); \ _os.write( (const char*)&tmp, sizeof(value_type) ); \ return _os.good() ? sizeof(value_type) : 0; \ } \ \ static size_t restore( std::istream& _is, value_type& _val, \ bool _swap=false) { \ _is.read( (char*)&_val, sizeof(value_type) ); \ if (_swap) reverse_byte_order(_val); \ return _is.good() ? sizeof(value_type) : 0; \ } \ }
Definition at line 136 of file SR_binary_spec.hh.
| #define VECTORT_BINARY | ( | T | ) |
template <> struct binary< T > { \ typedef T value_type; \ static const bool is_streamable = true; \ static size_t size_of(void) { return sizeof(value_type); } \ static size_t size_of(const value_type&) { return size_of(); } \ static size_t store( std::ostream& _os, const value_type& _val, \ bool _swap=false) { \ value_type tmp = _val; \ size_t i, b = size_of(_val), N = value_type::size_; \ if (_swap) for (i=0; i<N; ++i) \ reverse_byte_order( tmp[i] ); \ _os.write( (const char*)&tmp[0], b ); \ return _os.good() ? b : 0; \ } \ \ static size_t restore( std::istream& _is, value_type& _val, \ bool _swap=false) { \ size_t i, N=value_type::size_; \ size_t b = N * sizeof(value_type::value_type); \ _is.read( (char*)&_val[0], b ); \ if (_swap) for (i=0; i<N; ++i) \ reverse_byte_order( _val[i] ); \ return _is.good() ? b : 0; \ } \ }
Definition at line 166 of file SR_binary_spec.hh.
| #define VECTORTS_BINARY | ( | N | ) |
VECTORT_BINARY( Vec##N##c ); \ VECTORT_BINARY( Vec##N##uc ); \ VECTORT_BINARY( Vec##N##s ); \ VECTORT_BINARY( Vec##N##us ); \ VECTORT_BINARY( Vec##N##i ); \ VECTORT_BINARY( Vec##N##ui ); \ VECTORT_BINARY( Vec##N##f ); \ VECTORT_BINARY( Vec##N##d );
Definition at line 193 of file SR_binary_spec.hh.