BitMagic-C++
Public Types | Public Member Functions | Protected Attributes
bm::sparse_vector_serial_layout< SV > Struct Template Reference

layout class for serialization buffer structure More...

#include <bmsparsevec_serial.h>

Collaboration diagram for bm::sparse_vector_serial_layout< SV >:
Collaboration graph
[legend]

Public Types

typedef SV::value_type value_type
 
typedef SV::bvector_type bvector_type
 
typedef serializer< bvector_type >::buffer buffer_type
 

Public Member Functions

 sparse_vector_serial_layout ()
 
 ~sparse_vector_serial_layout ()
 
unsigned char * reserve (size_t capacity)
 resize capacity More...
 
size_t size () const
 return current serialized size More...
 
void resize (size_t ssize)
 Set new serialized size. More...
 
size_t capacity () const
 return serialization buffer capacity More...
 
void freemem ()
 free memory More...
 
void set_plain (unsigned i, unsigned char *ptr, unsigned buf_size)
 Set plain output pointer and size. More...
 
const unsigned char * get_plain (unsigned i) const
 Get plain pointer. More...
 
const unsigned char * buf () const
 Return serialization buffer pointer. More...
 

Protected Attributes

buffer_type buf_
 serialization buffer More...
 
unsigned char * plain_ptrs_ [SV::sv_plains]
 pointers on serialized bit-plains More...
 
unsigned plane_size_ [SV::sv_plains]
 serialized plain size More...
 

Detailed Description

template<class SV>
struct bm::sparse_vector_serial_layout< SV >

layout class for serialization buffer structure

Class keeps a memory block sized for the target sparse vector BLOB. This class also provides acess to bit-plane memory, so it becomes possible to use parallel storage methods to save bit-plains into different storage shards.

Examples:
rscsample01.cpp, and svsample02.cpp.

Definition at line 52 of file bmsparsevec_serial.h.

Member Typedef Documentation

◆ buffer_type

template<class SV>
typedef serializer<bvector_type>::buffer bm::sparse_vector_serial_layout< SV >::buffer_type

Definition at line 56 of file bmsparsevec_serial.h.

◆ bvector_type

template<class SV>
typedef SV::bvector_type bm::sparse_vector_serial_layout< SV >::bvector_type

Definition at line 55 of file bmsparsevec_serial.h.

◆ value_type

template<class SV>
typedef SV::value_type bm::sparse_vector_serial_layout< SV >::value_type

Definition at line 54 of file bmsparsevec_serial.h.

Constructor & Destructor Documentation

◆ sparse_vector_serial_layout()

template<class SV>
bm::sparse_vector_serial_layout< SV >::sparse_vector_serial_layout ( )
inline

Definition at line 58 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_serial_layout< SV >::buf().

◆ ~sparse_vector_serial_layout()

template<class SV>
bm::sparse_vector_serial_layout< SV >::~sparse_vector_serial_layout ( )
inline

Definition at line 62 of file bmsparsevec_serial.h.

Member Function Documentation

◆ buf()

template<class SV>
const unsigned char* bm::sparse_vector_serial_layout< SV >::buf ( ) const
inline

◆ capacity()

template<class SV>
size_t bm::sparse_vector_serial_layout< SV >::capacity ( ) const
inline

return serialization buffer capacity

Definition at line 89 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::buf_.

Referenced by bm::sparse_vector_serializer< SV >::serialize().

◆ freemem()

template<class SV>
void bm::sparse_vector_serial_layout< SV >::freemem ( )
inline

◆ get_plain()

template<class SV>
const unsigned char* bm::sparse_vector_serial_layout< SV >::get_plain ( unsigned  i) const
inline

◆ reserve()

template<class SV>
unsigned char* bm::sparse_vector_serial_layout< SV >::reserve ( size_t  capacity)
inline

resize capacity

Parameters
capacity- new capacity
Returns
new buffer or 0 if failed

Definition at line 71 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::buf_, and bm::sparse_vector_serial_layout< SV >::freemem().

Referenced by bm::sparse_vector_serializer< SV >::serialize().

◆ resize()

template<class SV>
void bm::sparse_vector_serial_layout< SV >::resize ( size_t  ssize)
inline

Set new serialized size.

Definition at line 86 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::buf_.

Referenced by bm::sparse_vector_serializer< SV >::serialize().

◆ set_plain()

template<class SV>
void bm::sparse_vector_serial_layout< SV >::set_plain ( unsigned  i,
unsigned char *  ptr,
unsigned  buf_size 
)
inline

◆ size()

template<class SV>
size_t bm::sparse_vector_serial_layout< SV >::size ( ) const
inline

return current serialized size

Definition at line 83 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::buf_.

Referenced by main().

Field Documentation

◆ buf_

template<class SV>
buffer_type bm::sparse_vector_serial_layout< SV >::buf_
protected

◆ plain_ptrs_

template<class SV>
unsigned char* bm::sparse_vector_serial_layout< SV >::plain_ptrs_[SV::sv_plains]
protected

pointers on serialized bit-plains

Definition at line 118 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_serial_layout< SV >::get_plain(), and bm::sparse_vector_serial_layout< SV >::set_plain().

◆ plane_size_

template<class SV>
unsigned bm::sparse_vector_serial_layout< SV >::plane_size_[SV::sv_plains]
protected

serialized plain size

Definition at line 119 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_serial_layout< SV >::set_plain().


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