binaryfilereader.h File Reference

Holds the template declaration for reading from a binary file. More...

#include "gvectors-config.h"
#include <stdlib.h>
#include <string.h>
#include <string>
#include <gfileio.h>
#include <gvectortypes.h>
#include <gvexceptions.h>
#include <vectorstore.h>
#include <filereader.h>
#include <visualvector.h>
#include <color.h>

Go to the source code of this file.

Namespaces

namespace  GVectors

Classes

class  GVectors::BinaryReader< Fct >
 The template used to read a VectorStore from a binary file. More...


Detailed Description

Author:
Rafael Ostertag
Holds the template declaration for reading from a binary file.

Writing and reading binary vector store files requires the libgfileio library. It can be downloaded from

http://www.guengel.ch/myapps/libgfileio.

See the figure below for information on the format of a binary vector store file.

                               3
           8      1  8      1  2                              1
          +--------++--------++--------------------------------+
(Header)  |Version ||Endianes||         # of Items             |
          +--------++--------++--------------------------------+
           3
           2                    1  8      1  8      1  8      1
          +----------------------++--------++--------..--------+
(Tag 1)   |Len of Tag in n Bytes || Byte 1 || Byte 2 .. Byte n |
          +----------------------++--------++--------..--------+
           3
           2                              1
/---      +--------------------------------+
|         |     Level of item in tree      |
|         +--------------------------------+
|          6
|          4                                                    1
|         +------------------------------------------------------+
|         | (double) x Component                                 |
|         +------------------------------------------------------+
|          6
|          4                                                    1
| V       +------------------------------------------------------+
| i       | (double) y Component                                 |
| s       +------------------------------------------------------+
| u        6
| a        4                                                    1
| l       +------------------------------------------------------+
| V       | (double) z Component                                 |
| e       +------------------------------------------------------+
| c        6
| t        4                                                    1
| o       +------------------------------------------------------+
| r       | (double) red Component                               |
|         +------------------------------------------------------+
| 1        6
|          4                                                    1
|         +------------------------------------------------------+
|         | (double) green Component                             |
|         +------------------------------------------------------+
|          6
|          4                                                    1
|         +------------------------------------------------------+
|         | (double) blue Component                              |
\---      +------------------------------------------------------+

                                     ...

           3
           2                    1  8      1  8      1  8      1
          +----------------------++--------++--------..--------+
(Tag n)   |Len of Tag in n Bytes || Byte 1 || Byte 2 .. Byte n |
          +----------------------++--------++--------..--------+
           3
           2                              1
/---      +--------------------------------+
|         |     Level of item in tree      |
|         +--------------------------------+
|          6
|          4                                                    1
|         +------------------------------------------------------+
|         | (double) x Component                                 |
|         +------------------------------------------------------+
|          6
|          4                                                    1
| V       +------------------------------------------------------+
| i       | (double) y Component                                 |
| s       +------------------------------------------------------+
| u        6
| a        4                                                    1
| l       +------------------------------------------------------+
| V       | (double) z Component                                 |
| e       +------------------------------------------------------+
| c        6
| t        4                                                    1
| o       +------------------------------------------------------+
| r       | (double) red Component                               |
|         +------------------------------------------------------+
| n        6
|          4                                                    1
|         +------------------------------------------------------+
|         | (double) green Component                             |
|         +------------------------------------------------------+
|          6
|          4                                                    1
|         +------------------------------------------------------+
|         | (double) blue Component                              |
\---      +------------------------------------------------------+

Remarks:
The length of the tag does not include the null-byte, which is not stored anyway.

Generated on Sat Sep 8 19:37:29 2007 for libgvectors by  doxygen 1.4.7