libigl v2.5.0
Loading...
Searching...
No Matches
serialize.h File Reference
#include <type_traits>
#include <iostream>
#include <fstream>
#include <cstdint>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <memory>
#include <list>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include "igl_inline.h"

Go to the source code of this file.

Classes

struct  igl::SerializableBase
 
class  igl::Serializable
 
struct  igl::IndexedPointerBase
 
struct  igl::IndexedPointer< T >
 
struct  igl::serialization::is_stl_container< T >
 
struct  igl::serialization::is_stl_container< std::pair< T1, T2 > >
 
struct  igl::serialization::is_stl_container< std::vector< T1, T2 > >
 
struct  igl::serialization::is_stl_container< std::set< T > >
 
struct  igl::serialization::is_stl_container< std::map< T1, T2 > >
 
struct  igl::serialization::is_stl_container< std::list< T > >
 
struct  igl::serialization::is_eigen_type< T >
 
struct  igl::serialization::is_eigen_type< Eigen::Matrix< T, R, C, P, MR, MC > >
 
struct  igl::serialization::is_eigen_type< Eigen::Array< T, R, C, P, MR, MC > >
 
struct  igl::serialization::is_eigen_type< Eigen::SparseMatrix< T, P, I > >
 
struct  igl::serialization::is_smart_ptr< T >
 
struct  igl::serialization::is_smart_ptr< std::shared_ptr< T > >
 
struct  igl::serialization::is_smart_ptr< std::unique_ptr< T > >
 
struct  igl::serialization::is_smart_ptr< std::weak_ptr< T > >
 
struct  igl::serialization::is_serializable< T >
 

Namespaces

namespace  igl
 
namespace  igl::serialization
 

Macros

#define SERIALIZE_TYPE(Type, Params)
 
#define SERIALIZE_TYPE_SOURCE(Type, Params)
 
#define SERIALIZE_MEMBER(Object)   igl::serializer(s,obj.Object,std::string(#Object),buffer);
 
#define SERIALIZE_MEMBER_NAME(Object, Name)   igl::serializer(s,obj.Object,std::string(Name),buffer);
 

Functions

template<typename T >
bool igl::serialize (const T &obj, const std::string &filename)
 
template<typename T >
bool igl::serialize (const T &obj, const std::string &objectName, const std::string &filename, bool overwrite=false)
 
template<typename T >
bool igl::serialize (const T &obj, const std::string &objectName, std::vector< char > &buffer)
 
template<typename T >
bool igl::deserialize (T &obj, const std::string &filename)
 
template<typename T >
bool igl::deserialize (T &obj, const std::string &objectName, const std::string &filename)
 
template<typename T >
bool igl::deserialize (T &obj, const std::string &objectName, const std::vector< char > &buffer)
 
template<typename T >
bool igl::serializer (bool serialize, T &obj, const std::string &filename)
 
template<typename T >
bool igl::serializer (bool serialize, T &obj, const std::string &objectName, const std::string &filename, bool overwrite=false)
 
template<typename T >
bool igl::serializer (bool serialize, T &obj, const std::string &objectName, std::vector< char > &buffer)
 
template<typename T >
std::enable_if<!is_serializable< T >::value, size_t >::type igl::serialization::getByteSize (const T &obj)
 
template<typename T >
std::enable_if<!is_serializable< T >::value >::type igl::serialization::serialize (const T &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
std::enable_if<!is_serializable< T >::value >::type igl::serialization::deserialize (T &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
std::enable_if< std::is_fundamental< T >::value, size_t >::type igl::serialization::getByteSize (const T &obj)
 
template<typename T >
std::enable_if< std::is_fundamental< T >::value >::type igl::serialization::serialize (const T &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
std::enable_if< std::is_fundamental< T >::value >::type igl::serialization::deserialize (T &obj, std::vector< char >::const_iterator &iter)
 
size_t igl::serialization::getByteSize (const std::string &obj)
 
void igl::serialization::serialize (const std::string &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
void igl::serialization::deserialize (std::string &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
std::enable_if< std::is_enum< T >::value, size_t >::type igl::serialization::getByteSize (const T &obj)
 
template<typename T >
std::enable_if< std::is_enum< T >::value >::type igl::serialization::serialize (const T &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
std::enable_if< std::is_enum< T >::value >::type igl::serialization::deserialize (T &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
std::enable_if< std::is_base_of< SerializableBase, T >::value, size_t >::type igl::serialization::getByteSize (const T &obj)
 
template<typename T >
std::enable_if< std::is_base_of< SerializableBase, T >::value >::type igl::serialization::serialize (const T &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
std::enable_if< std::is_base_of< SerializableBase, T >::value >::type igl::serialization::deserialize (T &obj, std::vector< char >::const_iterator &iter)
 
template<typename T1 , typename T2 >
size_t igl::serialization::getByteSize (const std::pair< T1, T2 > &obj)
 
template<typename T1 , typename T2 >
void igl::serialization::serialize (const std::pair< T1, T2 > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T1 , typename T2 >
void igl::serialization::deserialize (std::pair< T1, T2 > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T1 , typename T2 >
size_t igl::serialization::getByteSize (const std::vector< T1, T2 > &obj)
 
template<typename T1 , typename T2 >
void igl::serialization::serialize (const std::vector< T1, T2 > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T1 , typename T2 >
void igl::serialization::deserialize (std::vector< T1, T2 > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T2 >
void igl::serialization::deserialize (std::vector< bool, T2 > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
size_t igl::serialization::getByteSize (const std::set< T > &obj)
 
template<typename T >
void igl::serialization::serialize (const std::set< T > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
void igl::serialization::deserialize (std::set< T > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T1 , typename T2 >
size_t igl::serialization::getByteSize (const std::map< T1, T2 > &obj)
 
template<typename T1 , typename T2 >
void igl::serialization::serialize (const std::map< T1, T2 > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T1 , typename T2 >
void igl::serialization::deserialize (std::map< T1, T2 > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
size_t igl::serialization::getByteSize (const std::list< T > &obj)
 
template<typename T >
void igl::serialization::serialize (const std::list< T > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
void igl::serialization::deserialize (std::list< T > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T , int R, int C, int P, int MR, int MC>
size_t igl::serialization::getByteSize (const Eigen::Matrix< T, R, C, P, MR, MC > &obj)
 
template<typename T , int R, int C, int P, int MR, int MC>
void igl::serialization::serialize (const Eigen::Matrix< T, R, C, P, MR, MC > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T , int R, int C, int P, int MR, int MC>
void igl::serialization::deserialize (Eigen::Matrix< T, R, C, P, MR, MC > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T , int R, int C, int P, int MR, int MC>
size_t igl::serialization::getByteSize (const Eigen::Array< T, R, C, P, MR, MC > &obj)
 
template<typename T , int R, int C, int P, int MR, int MC>
void igl::serialization::serialize (const Eigen::Array< T, R, C, P, MR, MC > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T , int R, int C, int P, int MR, int MC>
void igl::serialization::deserialize (Eigen::Array< T, R, C, P, MR, MC > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T , int P, typename I >
size_t igl::serialization::getByteSize (const Eigen::SparseMatrix< T, P, I > &obj)
 
template<typename T , int P, typename I >
void igl::serialization::serialize (const Eigen::SparseMatrix< T, P, I > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T , int P, typename I >
void igl::serialization::deserialize (Eigen::SparseMatrix< T, P, I > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T , int P>
size_t igl::serialization::getByteSize (const Eigen::Quaternion< T, P > &obj)
 
template<typename T , int P>
void igl::serialization::serialize (const Eigen::Quaternion< T, P > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T , int P>
void igl::serialization::deserialize (Eigen::Quaternion< T, P > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
std::enable_if< std::is_pointer< T >::value, size_t >::type igl::serialization::getByteSize (const T &obj)
 
template<typename T >
std::enable_if< std::is_pointer< T >::value >::type igl::serialization::serialize (const T &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
std::enable_if< std::is_pointer< T >::value >::type igl::serialization::deserialize (T &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
std::enable_if< serialization::is_smart_ptr< T >::value, size_t >::type igl::serialization::getByteSize (const T &obj)
 
template<typename T >
std::enable_if< serialization::is_smart_ptr< T >::value >::type igl::serialization::serialize (const T &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<template< typename > class T0, typename T1 >
std::enable_if< serialization::is_smart_ptr< T0< T1 > >::value >::type igl::serialization::deserialize (T0< T1 > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
size_t igl::serialization::getByteSize (const std::weak_ptr< T > &obj)
 
template<typename T >
void igl::serialization::serialize (const std::weak_ptr< T > &obj, std::vector< char > &buffer, std::vector< char >::iterator &iter)
 
template<typename T >
void igl::serialization::deserialize (std::weak_ptr< T > &obj, std::vector< char >::const_iterator &iter)
 
template<typename T >
void igl::serialization::serialize (const T &obj, std::vector< char > &buffer)
 
template<typename T >
void igl::serialization::deserialize (T &obj, const std::vector< char > &buffer)
 
template<typename T >
void igl::serialization::updateMemoryMap (T &obj, size_t size)
 
template<typename T >
void igl::serialization::updateMemoryMap (T &obj, size_t size, std::map< std::uintptr_t, IndexedPointerBase * > &memoryMap)
 

Macro Definition Documentation

◆ SERIALIZE_TYPE

#define SERIALIZE_TYPE (   Type,
  Params 
)
Value:
namespace igl { namespace serialization { \
void _serialization(bool s,Type& obj,std::vector<char>& buffer) {Params} \
template<> inline void serialize(const Type& obj,std::vector<char>& buffer) { \
_serialization(true,const_cast<Type&>(obj),buffer); \
} \
template<> inline void deserialize(Type& obj,const std::vector<char>& buffer) { \
_serialization(false,obj,const_cast<std::vector<char>&>(buffer)); \
} \
}}
void deserialize(igl::opengl::ViewerCore &obj, const std::vector< char > &buffer)
Definition ViewerCore.h:286
void serialize(const igl::opengl::ViewerCore &obj, std::vector< char > &buffer)
Definition ViewerCore.h:280
Definition AABB.h:17

◆ SERIALIZE_TYPE_SOURCE

#define SERIALIZE_TYPE_SOURCE (   Type,
  Params 
)
Value:
namespace igl { namespace serialization { \
void _serialization(bool s,Type& obj,std::vector<char>& buffer) {Params} \
void _serialize(const Type& obj,std::vector<char>& buffer) { \
_serialization(true,const_cast<Type&>(obj),buffer); \
} \
void _deserialize(Type& obj,const std::vector<char>& buffer) { \
_serialization(false,obj,const_cast<std::vector<char>&>(buffer)); \
} \
}}

◆ SERIALIZE_MEMBER

#define SERIALIZE_MEMBER (   Object)    igl::serializer(s,obj.Object,std::string(#Object),buffer);

◆ SERIALIZE_MEMBER_NAME

#define SERIALIZE_MEMBER_NAME (   Object,
  Name 
)    igl::serializer(s,obj.Object,std::string(Name),buffer);