NDDEM
Public Types | Public Member Functions | Public Attributes | Related Functions | List of all members
cereal::BinaryData< T > Struct Template Reference

A wrapper around data that can be serialized in a binary fashion. More...

#include <helpers.hpp>

Public Types

using PT = typename std::conditional< std::is_const< typename std::remove_pointer< typename std::remove_reference< T >::type >::type >::value, const void *, void * >::type
 

Public Member Functions

 BinaryData (T &&d, uint64_t s)
 

Public Attributes

PT data
 pointer to beginning of data More...
 
uint64_t size
 size in bytes More...
 

Related Functions

(Note that these are not member functions.)

template<class T >
BinaryData< T > binary_data (T &&data, size_t size)
 Convenience function to create binary data for both const and non const pointers. More...
 

Detailed Description

template<class T>
struct cereal::BinaryData< T >

A wrapper around data that can be serialized in a binary fashion.

This class is used to demarcate data that can safely be serialized as a binary chunk of data. Individual archives can then choose how best represent this during serialization.

Member Typedef Documentation

◆ PT

template<class T >
using cereal::BinaryData< T >::PT = typename std::conditional<std::is_const<typename std::remove_pointer<typename std::remove_reference<T>::type>::type>::value, const void *, void *>::type

Internally store the pointer as a void *, keeping const if created with a const pointer

Constructor & Destructor Documentation

◆ BinaryData()

template<class T >
cereal::BinaryData< T >::BinaryData ( T &&  d,
uint64_t  s 
)
inline

Friends And Related Function Documentation

◆ binary_data()

template<class T >
BinaryData< T > binary_data ( T &&  data,
size_t  size 
)
related

Convenience function to create binary data for both const and non const pointers.

Parameters
dataPointer to beginning of the data
sizeThe size in bytes of the data

Member Data Documentation

◆ data

template<class T >
PT cereal::BinaryData< T >::data

pointer to beginning of data

◆ size

template<class T >
uint64_t cereal::BinaryData< T >::size

size in bytes


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