BitMagic-C++: sample4.cpp File Reference

BitMagic-C++

Functions | Variables
sample4.cpp File Reference

Example: bvector<> serialization/deserialization. More...

`#include <stdlib.h>`
`#include <iostream>`
`#include "bm.h"`
`#include "bmserial.h"`
Include dependency graph for sample4.cpp:

Go to the source code of this file.

## Functions
static void | fill_bvector (bm::bvector<> *bv)
static void | print_statistics (const bm::bvector<> &bv)
static unsigned char * | serialize_bvector (bm::serializer< bm::bvector<> > &bvs, bm::bvector<> &bv)
int | main (void)

## Variables
const unsigned | MAX_VALUE = 1000000

## Detailed Description

Example: bvector<> serialization/deserialization.

Definition in file sample4.cpp.

## Function Documentation

## ◆ fill_bvector()

static void fill_bvector | ( | bm::bvector<> * | bv | ) |
| static

Examples
  sample4.cpp.

Definition at line 49 of file sample4.cpp.

References MAX_VALUE, and bm::bvector< Alloc >::set_bit().

Referenced by main().

## ◆ main()

int main | ( | void |  | ) |

Examples
  sample4.cpp.

Definition at line 102 of file sample4.cpp.

References bm::bvector< Alloc >::bit_or(), bm::BM_GAP, bm::serializer< BV >::byte_order_serialization(), bm::bvector< Alloc >::compare(), bm::deserialize(), fill_bvector(), bm::serializer< BV >::gap_length_serialization(), bm::bvector< Alloc >::optimize(), bm::serializer< BV >::optimize_serialize_destroy(), print_statistics(), bm::serializer< BV >::serialize(), serialize_bvector(), and bm::bvector< Alloc >::set_new_blocks_strat().

## ◆ print_statistics()

static void print_statistics | ( | const bm::bvector<> & | bv | ) |
| static

Examples
  sample4.cpp.

Definition at line 61 of file sample4.cpp.

References bm::bv_statistics::bit_blocks, bm::bvector< Alloc >::calc_stat(), bm::bvector< Alloc >::count(), bm::bv_statistics::gap_blocks, bm::bv_statistics::max_serialize_mem, and bm::bv_statistics::memory_used.

Referenced by main().

## ◆ serialize_bvector()

static unsigned char* serialize_bvector | ( | bm::serializer< bm::bvector<> > & | bvs,
|  | bm::bvector<> & | bv
| ) |  |
| static

Examples
  sample4.cpp.

Definition at line 76 of file sample4.cpp.

References bm::bv_statistics::bit_blocks, BM_DECLARE_TEMP_BLOCK, bm::bvector< Alloc >::count(), bm::bv_statistics::gap_blocks, bm::bv_statistics::max_serialize_mem, bm::bv_statistics::memory_used, and bm::bvector< Alloc >::optimize().

Referenced by main().

## Variable Documentation

## ◆ MAX_VALUE

const unsigned MAX_VALUE = 1000000

Examples
  sample4.cpp.

Definition at line 42 of file sample4.cpp.

Referenced by fill_bvector().