Percy++
A C++ implementation of Private Information Retrieval (PIR) protocols
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Protected Attributes | List of all members
PercyServerParams Class Reference

Server parameters. More...

#include <percyparams.h>

Inheritance diagram for PercyServerParams:
RecursiveServerParams

Public Member Functions

 PercyServerParams (const PercyParams *params, nservers_t sid, bool be_byzantine=false)
 Constructor. More...
 
 PercyServerParams (const PercyParams *params, nservers_t sid, nservers_t num_threads=0, DistSplit tsplit=DIST_SPLIT_RECORDS, nservers_t num_workers=0, DistSplit wsplit=DIST_SPLIT_RECORDS, std::vector< nservers_t > worker_sids=std::vector< nservers_t >(), bool fork=false, bool be_byzantine=false)
 Constructor for parallel server computation. More...
 
virtual ~PercyServerParams ()
 Destructor. More...
 
void send (std::ostream &os, bool to_worker=false) const
 Send parameters and sid to client to test compatibility. More...
 
bool is_compatible (std::istream &is) const
 Test compatibility with client. More...
 
bool is_recursive () const
 Check if the server is recursive. More...
 
nservers_t get_sid () const
 Get the server ID. More...
 
bool is_byzantine () const
 Check if the server is Byzantine (responses incorrectly/maliciously). More...
 
bool is_threaded () const
 Check if the server is using multithreading. More...
 
nservers_t num_threads () const
 Get the number of threads being used. More...
 
DistSplit thread_split () const
 Get the method of partitioning work amoung threads. More...
 
bool use_forked_threads () const
 Check if the server is using forked processes instead of threading. More...
 
bool is_distributed () const
 Check if the server is using distributed computation. More...
 
nservers_t num_workers () const
 Get the number of worker processes being used. More...
 
DistSplit worker_split () const
 Get the method of partitioning work amoung workers. More...
 
const PercyParamsget_worker_params (nservers_t wid) const
 Get the protocol parameters for a worker. More...
 
std::vector< const PercyParams * > get_all_worker_params () const
 Get the protocol parameters for all workers. More...
 
const PercyServerParamsget_worker_serverparams (nservers_t wid) const
 Get the server parameters for a worker. More...
 
std::vector< const
PercyServerParams * > 
get_all_worker_serverparams () const
 Get the server parameters for all workers. More...
 
const PercyParamsget_thread_params (nservers_t wid) const
 Get the protocol parameters for a thread. More...
 
std::vector< const PercyParams * > get_all_thread_params () const
 Get the protocol parameters for all threads. More...
 
const PercyServerParamsget_thread_serverparams (nservers_t wid) const
 Get the server parameters for a thread. More...
 
std::vector< const
PercyServerParams * > 
get_all_thread_serverparams () const
 Get the server parameters for all threads. More...
 
void print (std::ostream &os) const
 Prints the parameters in CSV form. More...
 
virtual void print_distributed (std::ostream &os) const
 Print the distributed properties of the server. More...
 
const PercyParamspercy_params () const
 Get the protocol parameters. More...
 

Protected Attributes

const PercyParamsparams
 The protocol parameters. More...
 
nservers_t sid
 Server ID. More...
 
bool be_byzantine
 Whether or not the server is Byzantine. More...
 
nservers_t _num_threads
 The number of threads. More...
 
DistSplit tsplit
 The method of partitioning work between threads. More...
 
bool is_forked
 Whether or not the server is using forked processes instead of threading. More...
 
nservers_t _num_workers
 The number of workers. More...
 
DistSplit wsplit
 The method of partitioning work between workers. More...
 
std::vector< const PercyParams * > worker_params
 The workers' protocol parameters. More...
 
std::vector< const
PercyServerParams * > 
worker_serverparams
 The workers' server parameters. More...
 
std::vector< const PercyParams * > thread_params
 The threads' protocol parameters. More...
 
std::vector< const
PercyServerParams * > 
thread_serverparams
 The threads' server parameters. More...
 

Detailed Description

Server parameters.

Constructor & Destructor Documentation

PercyServerParams ( const PercyParams params,
nservers_t  sid,
bool  be_byzantine = false 
)

Constructor.

Parameters
paramsThe protocol parameters.
sidThe server ID.
be_byzantineIf true, do not send correct responses to the client.
PercyServerParams ( const PercyParams params,
nservers_t  sid,
nservers_t  num_threads = 0,
DistSplit  tsplit = DIST_SPLIT_RECORDS,
nservers_t  num_workers = 0,
DistSplit  wsplit = DIST_SPLIT_RECORDS,
std::vector< nservers_t >  worker_sids = std::vector< nservers_t >(),
bool  fork = false,
bool  be_byzantine = false 
)

Constructor for parallel server computation.

Parameters
paramsThe protocol parameters.
sidThe server ID.
num_threadsThe number of threads to distribute computation over.
tsplitThe method of partitioning work between threads.
num_workersThe number of workers to distributed computation over.
wsplitThe method of partitioning work between workers.
worker_sidsThe server IDs of workers.
forkIf true, use process forking instead of threading.
be_byzantineIf true, do not send correct responses to the client.
virtual ~PercyServerParams ( )
virtual

Destructor.

Member Function Documentation

std::vector<const PercyParams*> get_all_thread_params ( ) const
inline

Get the protocol parameters for all threads.

std::vector<const PercyServerParams*> get_all_thread_serverparams ( ) const
inline

Get the server parameters for all threads.

std::vector<const PercyParams*> get_all_worker_params ( ) const
inline

Get the protocol parameters for all workers.

std::vector<const PercyServerParams*> get_all_worker_serverparams ( ) const
inline

Get the server parameters for all workers.

nservers_t get_sid ( ) const
inline

Get the server ID.

const PercyParams* get_thread_params ( nservers_t  wid) const
inline

Get the protocol parameters for a thread.

Parameters
widIndex of the thread.
const PercyServerParams* get_thread_serverparams ( nservers_t  wid) const
inline

Get the server parameters for a thread.

Parameters
widIndex of the thread.
const PercyParams* get_worker_params ( nservers_t  wid) const
inline

Get the protocol parameters for a worker.

Parameters
widIndex of the worker.
const PercyServerParams* get_worker_serverparams ( nservers_t  wid) const
inline

Get the server parameters for a worker.

param wid Index of the worker.

bool is_byzantine ( ) const
inline

Check if the server is Byzantine (responses incorrectly/maliciously).

bool is_compatible ( std::istream &  is) const

Test compatibility with client.

Read parameters and a server ID from a client and test compatibility.

Parameters
isStream to read from.
Returns
Returns true if the client is compatible with this server; false otherwise.
bool is_distributed ( ) const
inline

Check if the server is using distributed computation.

bool is_recursive ( ) const
inline

Check if the server is recursive.

bool is_threaded ( ) const
inline

Check if the server is using multithreading.

nservers_t num_threads ( ) const
inline

Get the number of threads being used.

nservers_t num_workers ( ) const
inline

Get the number of worker processes being used.

const PercyParams* percy_params ( ) const
inline

Get the protocol parameters.

void print ( std::ostream &  os) const

Prints the parameters in CSV form.

Prints the protocol parameters and add the following server fields:

sid,byzantine,distributed_information,

where distributed_information is the result of print_distributed().

Parameters
osStream to print to.
virtual void print_distributed ( std::ostream &  os) const
virtual

Print the distributed properties of the server.

Reimplemented in RecursiveServerParams.

void send ( std::ostream &  os,
bool  to_worker = false 
) const

Send parameters and sid to client to test compatibility.

Parameters
osStream to write to.
to_workerIf true, the parameters are being sent to a worker.
DistSplit thread_split ( ) const
inline

Get the method of partitioning work amoung threads.

bool use_forked_threads ( ) const
inline

Check if the server is using forked processes instead of threading.

DistSplit worker_split ( ) const
inline

Get the method of partitioning work amoung workers.

Member Data Documentation

nservers_t _num_threads
protected

The number of threads.

nservers_t _num_workers
protected

The number of workers.

bool be_byzantine
protected

Whether or not the server is Byzantine.

bool is_forked
protected

Whether or not the server is using forked processes instead of threading.

const PercyParams* params
protected

The protocol parameters.

nservers_t sid
protected

Server ID.

std::vector<const PercyParams*> thread_params
protected

The threads' protocol parameters.

std::vector<const PercyServerParams*> thread_serverparams
protected

The threads' server parameters.

DistSplit tsplit
protected

The method of partitioning work between threads.

std::vector<const PercyParams*> worker_params
protected

The workers' protocol parameters.

std::vector<const PercyServerParams*> worker_serverparams
protected

The workers' server parameters.

DistSplit wsplit
protected

The method of partitioning work between workers.


The documentation for this class was generated from the following file: