Lens AI Profiler Cpp
Public Member Functions | List of all members
datasketches::serde< std::string > Struct Reference

#include <serde.hpp>

Public Member Functions

void serialize (std::ostream &os, const std::string *items, unsigned num) const
 
void deserialize (std::istream &is, std::string *items, unsigned num) const
 
size_t serialize (void *ptr, size_t capacity, const std::string *items, unsigned num) const
 
size_t deserialize (const void *ptr, size_t capacity, std::string *items, unsigned num) const
 
size_t size_of_item (const std::string &item) const
 

Detailed Description

serde for std::string items. This should produce sketches binary-compatible with ItemsSketch<String> with ArrayOfStringsSerDe in Java. The length of each string is stored as a 32-bit integer (historically), which may be too wasteful. Treat this as an example.

Member Function Documentation

◆ deserialize() [1/2]

size_t datasketches::serde< std::string >::deserialize ( const void *  ptr,
size_t  capacity,
std::string *  items,
unsigned  num 
) const
inline

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

◆ deserialize() [2/2]

void datasketches::serde< std::string >::deserialize ( std::istream &  is,
std::string *  items,
unsigned  num 
) const
inline

Stream deserialization

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

◆ serialize() [1/2]

void datasketches::serde< std::string >::serialize ( std::ostream &  os,
const std::string *  items,
unsigned  num 
) const
inline

Stream serialization

Parameters
osoutput stream
itemspointer to array of items
numnumber of items

◆ serialize() [2/2]

size_t datasketches::serde< std::string >::serialize ( void *  ptr,
size_t  capacity,
const std::string *  items,
unsigned  num 
) const
inline

Raw bytes serialization

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

◆ size_of_item()

size_t datasketches::serde< std::string >::size_of_item ( const std::string &  item) const
inline

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: