datasketches-cpp
Public Member Functions | List of all members
serde< T, Enable > Struct Template Reference

Interface for serializing and deserializing items. More...

#include <serde.hpp>

Public Member Functions

void serialize (std::ostream &os, const T *items, unsigned num) const
 Stream serialization. More...
 
void deserialize (std::istream &is, T *items, unsigned num) const
 Stream deserialization. More...
 
size_t serialize (void *ptr, size_t capacity, const T *items, unsigned num) const
 Raw bytes serialization. More...
 
size_t deserialize (const void *ptr, size_t capacity, T *items, unsigned num) const
 Raw bytes deserialization. More...
 
size_t size_of_item (const T &item) const
 Size of the given item. More...
 

Detailed Description

template<typename T, typename Enable = void>
struct datasketches::serde< T, Enable >

Interface for serializing and deserializing items.

Member Function Documentation

◆ serialize() [1/2]

void serialize ( std::ostream &  os,
const T *  items,
unsigned  num 
) const

Stream serialization.

Parameters
osoutput stream
itemspointer to array of items
numnumber of items

◆ deserialize() [1/2]

void deserialize ( std::istream &  is,
T *  items,
unsigned  num 
) const

Stream deserialization.

Parameters
isinput stream
itemspointer to array of items (items in the array are allocated but not initialized)
numnumber of items

◆ serialize() [2/2]

size_t serialize ( void *  ptr,
size_t  capacity,
const T *  items,
unsigned  num 
) const

Raw bytes serialization.

Parameters
ptrpointer to output buffer
capacitysize of the buffer in bytes
itemspointer to array of items
numnumber of items

◆ deserialize() [2/2]

size_t deserialize ( const void *  ptr,
size_t  capacity,
T *  items,
unsigned  num 
) const

Raw bytes deserialization.

Parameters
ptrpointer to input buffer
capacitysize of the buffer in bytes
itemspointer to array of items (items in the array are allocated but not initialized)
numnumber of items

◆ size_of_item()

size_t size_of_item ( const T &  item) const

Size of the given item.

Parameters
itemto be sized
Returns
size of the given item in bytes

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