Eigen::Serializer< DenseBase< Derived >, void > Class Template Reference

Classes

struct  Header
 

Public Types

typedef Derived::Scalar Scalar
 

Public Member Functions

const uint8_t * deserialize (const uint8_t *src, const uint8_t *end, Derived &value) const
 
uint8_t * serialize (uint8_t *dest, uint8_t *end, const Derived &value)
 
size_t size (const Derived &value) const
 

Detailed Description

template<typename Derived>
class Eigen::Serializer< DenseBase< Derived >, void >

Definition at line 80 of file Serializer.h.

Member Typedef Documentation

◆ Scalar

template<typename Derived >
typedef Derived::Scalar Eigen::Serializer< DenseBase< Derived >, void >::Scalar

Definition at line 82 of file Serializer.h.

Member Function Documentation

◆ deserialize()

template<typename Derived >
const uint8_t* Eigen::Serializer< DenseBase< Derived >, void >::deserialize ( const uint8_t *  src,
const uint8_t *  end,
Derived &  value 
) const
inline

Definition at line 106 of file Serializer.h.

106  {
107  if (EIGEN_PREDICT_FALSE(src == nullptr)) return nullptr;
108  if (EIGEN_PREDICT_FALSE(src + sizeof(Header) > end)) return nullptr;
109  const size_t header_bytes = sizeof(Header);
110  Header header;
111  EIGEN_USING_STD(memcpy)
112  memcpy(&header, src, header_bytes);
113  src += header_bytes;
114  const size_t data_bytes = sizeof(Scalar) * header.rows * header.cols;
115  if (EIGEN_PREDICT_FALSE(src + data_bytes > end)) return nullptr;
116  value.resize(header.rows, header.cols);
117  memcpy(value.data(), src, data_bytes);
118  return src + data_bytes;
119  }
if((m *x).isApprox(y))
#define EIGEN_USING_STD(FUNC)
Definition: Macros.h:1080
#define EIGEN_PREDICT_FALSE(x)
Definition: Macros.h:1177
static const lastp1_t end

◆ serialize()

template<typename Derived >
uint8_t* Eigen::Serializer< DenseBase< Derived >, void >::serialize ( uint8_t *  dest,
uint8_t *  end,
const Derived &  value 
)
inline

Definition at line 93 of file Serializer.h.

93  {
94  if (EIGEN_PREDICT_FALSE(dest == nullptr)) return nullptr;
95  if (EIGEN_PREDICT_FALSE(dest + size(value) > end)) return nullptr;
96  const size_t header_bytes = sizeof(Header);
97  const size_t data_bytes = sizeof(Scalar) * value.size();
98  Header header = {value.rows(), value.cols()};
99  EIGEN_USING_STD(memcpy)
100  memcpy(dest, &header, header_bytes);
101  dest += header_bytes;
102  memcpy(dest, value.data(), data_bytes);
103  return dest + data_bytes;
104  }
size_t size(const Derived &value) const
Definition: Serializer.h:89

◆ size()

template<typename Derived >
size_t Eigen::Serializer< DenseBase< Derived >, void >::size ( const Derived &  value) const
inline

Definition at line 89 of file Serializer.h.

89  {
90  return sizeof(Header) + sizeof(Scalar) * value.size();
91  }

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