Fully inlined C++ class wrappers are also included in the distribution and all example programs are presented with respect to both C and C++ interfaces for comparison.
General Structure
The API consists primarily of interfaces for constructing and manipulating in-memory databases. These interfaces all begin with the prefix es_mb
- as in es_mb
, es_mbd
, es_mbc
and so on. The remaining interfaces are either for constructing data to store in databases, such as dates (es_date
) and strings (es_sd
) or for use in serializing databases to disk or across networks, such as read and write buffers (es_rb
and es_wb
) and socket management (es_sock
).
Each function in the API has the name of the interface to which it belongs as a name-prefix. Each interface, with the exception of es_date and es_sock, has a corresponding opaque data pointer or handle used for maintaining state (a sort of this pointer). For example, here are the declarations for the handle and a few of the functions of the string dictionary (es_sd
) interface.
/* string dictionary handle */
struct es_sd;
/* construct new string dictionary */
struct es_sd *es_sd_new( unsigned chunksize, int storestrings );
/* destroy string dictionary and recovery all memory */
void es_sd_delete( struct es_sd *dict );
/* find id for string and add to dictionary if missing */
unsigned es_sd_add( struct es_sd *dict, unsigned *idx, const char *cptr );
[Back To Top]
Key Relationships
The diagram below shows the key relationships between the core interfaces used to construct and manipulate in-memory databases.
Each database instance (es_mb
) corresponds to a database definition or schema (es_mbd
) that describes it's structure. A database definition consists of a set of database classes (es_mbc
) each of which defines the set of fields, indicies and parent relationships for a set of database nodes (es_mbn
). Each node consist of a set of rows, or tuples, of data. A set of nodes collectively form a database instance (es_mb
).
Databases can be traversed or updated via iterators (es_mbi
) and sorted iterators (es_mbs
). Iterators fetch from or update a database via program variables that are bound to database fields via a field-binding object (es_mbb
).
[Back To Top]
Interface Summary
The set of interfaces in the exstreamspeed API are summarized below.