Developer Documentation
OpenMesh::IO::binary< T, typename > Struct Template Reference

#include <OpenMesh/Core/IO/SR_binary.hh>

Public Types

typedef T value_type
 

Static Public Member Functions

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. More...
 
static size_t size_of (const value_type &)
 What't the size of a specific value of type T. More...
 
static std::string type_identifier (void)
 A string that identifies the type of T. More...
 
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. More...
 
static size_t restore (std::istream &, value_type &, bool=false, bool=true)
 Restore a value of T and return the number of bytes read. More...
 

Static Public Attributes

static const bool is_streamable = false
 Can we store T? Set this to true in your specialization. More...
 

Detailed Description

template<typename T, typename = void>
struct OpenMesh::IO::binary< T, typename >

The struct defines how to store and restore the type T. It's used by the OM reader/writer modules.

The following specialization are provided:

  • Fundamental types except long
  • OpenMesh vector types
  • OpenMesh::StatusInfo
  • std::string (max. length 65535)
  • std::vector<T> (requires a specialization for T)

    Todo:
    Complete documentation of members

Definition at line 96 of file SR_binary.hh.

Member Typedef Documentation

◆ value_type

template<typename T , typename = void>
typedef T OpenMesh::IO::binary< T, typename >::value_type

Definition at line 98 of file SR_binary.hh.

Member Function Documentation

◆ restore()

template<typename T , typename = void>
static size_t OpenMesh::IO::binary< T, typename >::restore ( std::istream &  ,
value_type &  ,
bool  = false,
bool  = true 
)
inlinestatic

Restore a value of T and return the number of bytes read.

Definition at line 125 of file SR_binary.hh.

◆ size_of() [1/2]

template<typename T , typename = void>
static size_t OpenMesh::IO::binary< T, typename >::size_of ( const value_type &  )
inlinestatic

What't the size of a specific value of type T.

Definition at line 106 of file SR_binary.hh.

◆ size_of() [2/2]

template<typename T , typename = void>
static size_t OpenMesh::IO::binary< T, typename >::size_of ( void  )
inlinestatic

What's the size of T? If it depends on the actual value (e.g. for vectors) return UnknownSize.

Definition at line 104 of file SR_binary.hh.

◆ store()

template<typename T , typename = void>
static size_t OpenMesh::IO::binary< T, typename >::store ( std::ostream &  ,
const value_type &  ,
bool  = false,
bool  = true 
)
inlinestatic

Store a value of T and return the number of bytes written.

Definition at line 113 of file SR_binary.hh.

◆ type_identifier()

template<typename T , typename = void>
static std::string OpenMesh::IO::binary< T, typename >::type_identifier ( void  )
inlinestatic

A string that identifies the type of T.

Definition at line 109 of file SR_binary.hh.

Member Data Documentation

◆ is_streamable

template<typename T , typename = void>
const bool OpenMesh::IO::binary< T, typename >::is_streamable = false
static

Can we store T? Set this to true in your specialization.

Definition at line 101 of file SR_binary.hh.


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