SR_binary_spec.hh File Reference

#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>
Include dependency graph for SR_binary_spec.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OpenMesh::IO::binary< OpenMesh::Attributes::StatusInfo >
struct  OpenMesh::IO::binary< std::string >
struct  OpenMesh::IO::binary< std::vector< bool > >
struct  OpenMesh::IO::binary< std::vector< std::string > >
struct  OpenMesh::IO::FunctorRestore< T >
struct  OpenMesh::IO::FunctorStore< T >
struct  OpenMesh::IO::binary< std::vector< std::string > >::Sum

Namespaces

namespace  OpenMesh
namespace  OpenMesh::IO

Defines

#define BINARY_VECTOR(T)
#define SIMPLE_BINARY(T)
#define SIMPLE_BINARY(T)
#define VECTORT_BINARY(T)
#define VECTORTS_BINARY(N)

Functions

 OpenMesh::IO::BINARY_VECTOR (double)
 OpenMesh::IO::BINARY_VECTOR (float)
 OpenMesh::IO::BINARY_VECTOR (long)
 OpenMesh::IO::BINARY_VECTOR (int)
 OpenMesh::IO::BINARY_VECTOR (unsigned short)
 OpenMesh::IO::BINARY_VECTOR (short)
 OpenMesh::IO::SIMPLE_BINARY (unsigned long)
 OpenMesh::IO::SIMPLE_BINARY (uint64_t)
 OpenMesh::IO::SIMPLE_BINARY (uint32_t)
 OpenMesh::IO::SIMPLE_BINARY (uint16_t)
 OpenMesh::IO::SIMPLE_BINARY (uint8_t)
 OpenMesh::IO::SIMPLE_BINARY (int64_t)
 OpenMesh::IO::SIMPLE_BINARY (int32_t)
 OpenMesh::IO::SIMPLE_BINARY (int16_t)
 OpenMesh::IO::SIMPLE_BINARY (int8_t)
 OpenMesh::IO::SIMPLE_BINARY (long double)
 OpenMesh::IO::SIMPLE_BINARY (double)
 OpenMesh::IO::SIMPLE_BINARY (float)
 OpenMesh::IO::SIMPLE_BINARY (bool)
 OpenMesh::IO::VECTORTS_BINARY (6)
 OpenMesh::IO::VECTORTS_BINARY (4)
 OpenMesh::IO::VECTORTS_BINARY (3)
 OpenMesh::IO::VECTORTS_BINARY (2)
 OpenMesh::IO::VECTORTS_BINARY (1)

Define Documentation

#define BINARY_VECTOR (  ) 

Definition at line 3 of file SR_binary_spec.hh.

#define SIMPLE_BINARY (  ) 
Value:
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 (  ) 
Value:
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 (  ) 
Value:
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 (  ) 
Value:
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.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


openmesh
Author(s): Benjamin Pitzer
autogenerated on Fri Jan 11 12:11:04 2013