odb_data Struct Reference

a "database". More...

#include <odb.h>

Collaboration diagram for odb_data:

Collaboration graph
[legend]
List of all members.

Public Attributes

odb_node_tnode_base
 base memory area of the page
odb_index_thash_base
 base memory of hash table
odb_descr_tdescr
 the current state of database
odb_hash_mask_t hash_mask
 == descr->size - 1
unsigned int sizeof_header
 from base_memory to odb header
unsigned int offset_node
 from base_memory to node array
void * base_memory
 base memory of the maped memory
int fd
 mmaped memory file descriptor
char * filename
 full path name of sample file
int ref_count
 reference count
list_head list
 hash bucket list

Detailed Description

a "database".

this is an in memory only description.

We allow to manage a database inside a mapped file with an "header" of unknown size so odb_open get a parameter to specify the size of this header. A typical use is:

struct header { int etc; ... }; odb_open(&hash, filename, ODB_RW, sizeof(header)); so on this library have no dependency on the header type.

the internal memory layout from base_memory is: the unknown header (sizeof_header) odb_descr_t the node array: (descr->size * sizeof(odb_node_t) entries the hash table: array of odb_index_t indexing the node array (descr->size * BUCKET_FACTOR) entries


Member Data Documentation

void* odb_data::base_memory
 

base memory of the maped memory

odb_descr_t* odb_data::descr
 

the current state of database

int odb_data::fd
 

mmaped memory file descriptor

char* odb_data::filename
 

full path name of sample file

odb_index_t* odb_data::hash_base
 

base memory of hash table

odb_hash_mask_t odb_data::hash_mask
 

== descr->size - 1

struct list_head odb_data::list
 

hash bucket list

odb_node_t* odb_data::node_base
 

base memory area of the page

unsigned int odb_data::offset_node
 

from base_memory to node array

int odb_data::ref_count
 

reference count

unsigned int odb_data::sizeof_header
 

from base_memory to odb header


The documentation for this struct was generated from the following file:
Generated on Thu Jul 17 19:54:28 2008 for oprofile by  doxygen 1.4.6