include/lshkit/archive.h File Reference
A set of binary I/O routines. More...
#include <vector>
#include <iostream>
Go to the source code of this file.
|
Namespaces |
namespace | lshkit |
Functions |
template<typename D> |
std::ostream & | lshkit::operator & (std::ostream &s, D &t) |
template<typename D> |
std::istream & | lshkit::operator & (std::istream &s, D &t) |
template<typename D> |
std::ostream & | lshkit::operator & (std::ostream &os, std::vector< D > &v) |
template<typename D> |
std::istream & | lshkit::operator & (std::istream &is, std::vector< D > &v) |
Detailed Description
A set of binary I/O routines.
The LSH library was originally designed to use boost serialization, but it turned out that boost serialization is too generalized and too slow for us. So we wrote our own minimal replacement.
You are not expected to use these routines unless you are implementing your own LSH class.
Given a variable V and a stream S, "S & V" will output V to S if S is derived from std::ostream, or load V from S if S is derived from std::istream. The operator is defined for the following types:
- classes where a "serialize" method is defined (required by the LSH concept);
- std::vector of such classes;
- unsigned, float, std::vector<unsigned>, std::vector<float>.
Note that binary I/O is architecture dependent and not portable.