sample4.cpp File Reference

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

`#include <stdlib.h>`
`#include <iostream>`
`#include "bm.h"`
`#include "bmserial.h"`
`#include "bmundef.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()

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

static

Definition at line 51 of file sample4.cpp.

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

Referenced by main().

## main()

int main | ( | void |  | ) |

Definition at line 106 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 >::opt_compress, 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()

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

static

Definition at line 63 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()

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

static

Examples
  sample4.cpp.

Definition at line 78 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, bm::bvector< Alloc >::opt_compress, and bm::bvector< Alloc >::optimize().

Referenced by main().

## Variable Documentation

## MAX_VALUE

const unsigned MAX_VALUE = 1000000

Definition at line 44 of file sample4.cpp.