20 #ifndef __DATASTORE_H__
21 #define __DATASTORE_H__
23 #include <NTL/mat_ZZ_p.h>
36 unsigned char *database;
70 const unsigned char *
get_data()
const {
return database;}
95 unsigned char *mapptr;
96 dboffset_t map_offset;
105 dboffset_t offset = 0);
virtual ~FileDataStore()
Destructor.
const PercyParams * params
Parameters for the protocol.
Definition: datastore.h:42
dbsize_t num_blocks
Number of blocks in the database.
Definition: datastore.h:46
A simple database object.
Definition: datastore.h:34
vector< DataStore * > get_worker_datastores() const
Get the database objects for the threads/workers.
Definition: datastore.h:78
void set_database(unsigned char *data=NULL)
Change the database pointer.
dbsize_t block_size
Size of each database block in bytes.
Definition: datastore.h:44
DataStore * get_worker_datastore(nservers_t worker_index) const
Get the database object for a thread/worker.
Definition: datastore.h:84
A database that is backed by one contiguous file.
Definition: datastore.h:92
An abstract base class for a protocol's parameters.
Definition: percyparams.h:80
const unsigned char * get_data() const
Get a pointer to the database in memory.
Definition: datastore.h:70
std::vector< DataStore * > subdatastores
The database objects for the threads/workers.
Definition: datastore.h:57
std::vector< dbsize_t > subdb_offsets
The distance from the beginning of the database that each thread/worker's portion of the database beg...
Definition: datastore.h:55
dbsize_t database_size
Total size of the database in bytes.
Definition: datastore.h:48
FileDataStore(const char *filename, const PercyServerParams *params, dboffset_t offset=0)
Constructor.
const PercyServerParams * serverparams
Parameters for the server.
Definition: datastore.h:40
nservers_t num_workers
Number of threads/workers.
Definition: datastore.h:52
Server parameters.
Definition: percyparams.h:251
Defines the basic structure of protocol parameters (PercyParams), client parameters (PercyClientParam...
virtual ~DataStore()
Destructor.
DataStore(unsigned char *database, const PercyServerParams *params)
Constructor.