Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
|
A simple database object. More...
#include <datastore.h>
Public Member Functions | |
DataStore (unsigned char *database, const PercyServerParams *params) | |
Constructor. More... | |
virtual | ~DataStore () |
Destructor. More... | |
const unsigned char * | get_data () const |
Get a pointer to the database in memory. More... | |
void | set_database (unsigned char *data=NULL) |
Change the database pointer. More... | |
vector< DataStore * > | get_worker_datastores () const |
Get the database objects for the threads/workers. More... | |
DataStore * | get_worker_datastore (nservers_t worker_index) const |
Get the database object for a thread/worker. More... | |
Protected Attributes | |
const PercyServerParams * | serverparams |
Parameters for the server. More... | |
const PercyParams * | params |
Parameters for the protocol. More... | |
dbsize_t | block_size |
Size of each database block in bytes. More... | |
dbsize_t | num_blocks |
Number of blocks in the database. More... | |
dbsize_t | database_size |
Total size of the database in bytes. More... | |
nservers_t | num_workers |
Number of threads/workers. More... | |
std::vector< dbsize_t > | subdb_offsets |
The distance from the beginning of the database that each thread/worker's portion of the database begins. More... | |
std::vector< DataStore * > | subdatastores |
The database objects for the threads/workers. More... | |
A simple database object.
Stores a database that is a contiguous block of memory.
DataStore | ( | unsigned char * | database, |
const PercyServerParams * | params | ||
) |
Constructor.
database | A pointer to the database in memory. |
params | The server parameters. |
|
virtual |
Destructor.
|
inline |
Get a pointer to the database in memory.
|
inline |
Get the database object for a thread/worker.
worker_index | The index of a worker. |
|
inline |
Get the database objects for the threads/workers.
void set_database | ( | unsigned char * | data = NULL | ) |
Change the database pointer.
data | The location of the new database in memory. |
|
protected |
Size of each database block in bytes.
|
protected |
Total size of the database in bytes.
|
protected |
Number of blocks in the database.
|
protected |
Number of threads/workers.
|
protected |
Parameters for the protocol.
|
protected |
Parameters for the server.
|
protected |
The database objects for the threads/workers.
|
protected |
The distance from the beginning of the database that each thread/worker's portion of the database begins.