-
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathdataserver.h
More file actions
33 lines (27 loc) · 565 Bytes
/
dataserver.h
File metadata and controls
33 lines (27 loc) · 565 Bytes
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
#ifndef _DATA_SERVER_H
#define _DATA_SERVER_H
#include <string>
#include <mutex>
#include <condition_variable>
extern int chunkSize;
class DataServer{
private:
std::string name_;
double size_;
void put();
void read();
void locate();
void fetch();
public:
std::mutex mtx;
std::condition_variable cv;
std::string cmd;
int fid, bufSize, offset;
char* buf;
bool finish;
DataServer(const std::string &name);
void operator()();
double size()const{return size_;}
std::string get_name()const;
};
#endif