1
/* $Id: Parameters.cpp,v 1.9 2003/06/23 14:38:42 terpstra Exp $
3
* Parameters.cpp - Control how the database is stored
5
* Copyright (C) 2002 - Wesley W. Terpstra
9
* Authors: 'Wesley W. Terpstra' <wesley@terpstra.ca>
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; version 2.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
#define _XOPEN_SOURCE 500
26
#define _FILE_OFFSET_BITS 64
36
Parameters::Parameters(
40
unsigned long blockSize,
41
unsigned long keySize)
42
: version_(version), blockSize_(blockSize), keySize_(keySize), unique_(unique), synced_(synced)
44
assert (keySize_ > 0);
45
assert (keySize_ * 8 <= blockSize_);
47
keyWidth_ = static_cast<int>(
49
log(static_cast<double>(keySize_)) /
54
bool Parameters::isWider(const Parameters& p)
56
return version_ > p.version_ ||
57
blockSize_ > p.blockSize_ ||
58
keySize_ > p.keySize_;