BitMagic-C++: bm::sparse_vector_serial_layout< SV > Struct Template Reference

BitMagic-C++

Public Types | Public Member Functions | Protected Attributes
bm::sparse_vector_serial_layout< SV > Struct Template Reference
BitMagic Library » Sparse and compressed vectors » Sparse vector serialization

layout class for serialization buffer structure More...

`#include <bmsparsevec_serial.h>`

Collaboration diagram for bm::sparse_vector_serial_layout< SV >:
[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, size_t 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...
const unsigned char * | data () 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...
size_t | 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, rscsample02.cpp, strsvsample03.cpp, strsvsample05.cpp, svsample02.cpp, and svsample08.cpp.

Definition at line 57 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 61 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 60 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 59 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 63 of file bmsparsevec_serial.h.

## ◆ ~sparse_vector_serial_layout()

template<class SV >

bm::sparse_vector_serial_layout< SV >::~sparse_vector_serial_layout | ( |  | ) |
| inline

Definition at line 65 of file bmsparsevec_serial.h.

## Member Function Documentation

## ◆ buf()

template<class SV >

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

Return serialization buffer pointer.

Definition at line 106 of file bmsparsevec_serial.h.

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

Referenced by main().

## ◆ capacity()

template<class SV >

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

return serialization buffer capacity

Definition at line 90 of file bmsparsevec_serial.h.

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

Referenced by bm::sparse_vector_serial_layout< SV >::reserve(), and bm::sparse_vector_serializer< SV >::serialize().

## ◆ data()

template<class SV >

const unsigned char* bm::sparse_vector_serial_layout< SV >::data | ( |  | ) | const
| inline

Return serialization buffer pointer.

Definition at line 108 of file bmsparsevec_serial.h.

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

## ◆ freemem()

template<class SV >

void bm::sparse_vector_serial_layout< SV >::freemem | ( |  | ) |
| inline

free memory

Definition at line 93 of file bmsparsevec_serial.h.

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

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

## ◆ get_plain()

template<class SV >

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

Get plain pointer.

Definition at line 103 of file bmsparsevec_serial.h.

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

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

## ◆ 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 72 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::buf_, bm::sparse_vector_serial_layout< SV >::capacity(), 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 87 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,
|  | size_t | buf_size
| ) |  |
| inline

Set plain output pointer and size.

Definition at line 96 of file bmsparsevec_serial.h.

References bm::sparse_vector_serial_layout< SV >::plain_ptrs_, and bm::sparse_vector_serial_layout< SV >::plane_size_.

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

## ◆ size()

template<class SV >

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

return current serialized size

Definition at line 84 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

serialization buffer

Definition at line 114 of file bmsparsevec_serial.h.

Referenced by bm::sparse_vector_serial_layout< SV >::buf(), bm::sparse_vector_serial_layout< SV >::capacity(), bm::sparse_vector_serial_layout< SV >::data(), bm::sparse_vector_serial_layout< SV >::freemem(), bm::sparse_vector_serial_layout< SV >::reserve(), bm::sparse_vector_serial_layout< SV >::resize(), and bm::sparse_vector_serial_layout< SV >::size().

## ◆ 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 115 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 >

size_t bm::sparse_vector_serial_layout< SV >::plane_size_[SV::sv_plains]
| protected

serialized plain size

Definition at line 116 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:

- bmsparsevec_serial.h