-
Notifications
You must be signed in to change notification settings - Fork 113
/
bbs.h
76 lines (62 loc) · 1.9 KB
/
bbs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#pragma once
#include "bbsimpl.h"
class IvocVect;
class BBS {
public:
BBS();
BBS(int nhost);
virtual ~BBS();
bool look(const char*);
void take(const char*); /* blocks til something to take */
bool look_take(const char*); /* returns false if nothing to take */
// after taking use these
int upkint();
double upkdouble();
void upkvec(int n, double* px); // n input px space must exist
char* upkstr(); // delete [] char* when finished
char* upkpickle(size_t* size); // delete [] char* when finished
// before posting use these
void pkbegin();
void pkint(int);
void pkdouble(double);
void pkvec(int n, double* px); // doesn't pack n
void pkstr(const char*);
void pkpickle(const char*, size_t size);
void post(const char*);
int submit(int userid);
bool working(int& id, double& x, int& userid);
void master_works(int flag);
void context();
bool is_master();
void worker(); // forever execute
void done(); // prints timing
void perror(const char*);
double time();
double wait_time();
double integ_time();
double send_time();
void add_wait_time(double); // add interval since arg
int nhost();
int myid();
// netpar interface
void set_gid2node(int, int);
int gid_exists(int);
double threshold();
void cell();
void outputcell(int);
void spike_record(int, IvocVect*, IvocVect*);
void spike_record(IvocVect*, IvocVect*, IvocVect*);
void netpar_solve(double);
Object** gid2obj(int);
Object** gid2cell(int);
Object** gid_connect(int);
double netpar_mindelay(double maxdelay);
void netpar_spanning_statistics(int*, int*, int*, int*);
IvocVect* netpar_max_histogram(IvocVect*);
Object** pyret();
protected:
void init(int);
protected:
BBSImpl* impl_;
};
void writeMessage(BBS* impl, Message& mess);