#include <iostream>
#include <stdlib.h>
#include <ham/hamsterdb.hpp>
Go to the source code of this file.
Data Structures | |
struct | customer_t |
struct | order_t |
Defines | |
#define | MAX_DBS 3 |
#define | DBNAME_CUSTOMER 1 |
#define | DBNAME_ORDER 2 |
#define | DBNAME_C2O 3 |
#define | DBIDX_CUSTOMER 0 |
#define | DBIDX_ORDER 1 |
#define | DBIDX_C2O 2 |
#define | MAX_CUSTOMERS 4 |
#define | MAX_ORDERS 8 |
Functions | |
int | run_demo (void) |
int | main (int argc, char **argv) |
#define MAX_DBS 3 |
Copyright (C) 2005-2007 Christoph Rupp (chris@crupp.de).
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
See files COPYING.* for License information.
This sample does the same as env2, but uses the C++ API.
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 268 of file env3.cpp.
References ham::error::get_errno(), ham::error::get_string(), and run_demo().
int run_demo | ( | void | ) |
Definition at line 56 of file env3.cpp.
References ham::cursor::create(), ham::env::create(), ham::env::create_db(), DBIDX_C2O, DBIDX_CUSTOMER, DBIDX_ORDER, DBNAME_C2O, DBNAME_CUSTOMER, DBNAME_ORDER, ham::db::find(), ham::cursor::find(), ham::record::get_data(), ham::error::get_errno(), ham::error::get_string(), HAM_CURSOR_NEXT, HAM_DUPLICATE, HAM_ENABLE_DUPLICATES, HAM_KEY_NOT_FOUND, HAM_ONLY_DUPLICATES, customer_t::id, ham::db::insert(), MAX_CUSTOMERS, MAX_DBS, MAX_ORDERS, ham::cursor::move(), ham::cursor::move_next(), customer_t::name, ham::record::set_data(), ham::key::set_data(), ham::record::set_size(), and ham::key::set_size().