-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextent_server.h
52 lines (36 loc) · 1.08 KB
/
extent_server.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
// this is the extent server
#ifndef extent_server_h
#define extent_server_h
#include <string>
#include <map>
#include "extent_protocol.h"
#define IS_FILE 0x80000000
#define DEBUG 0
class extent_server {
public:
/* struct fileInfo{
extent_protocol::attr fAttr;
std::string fContent;
};
struct dirInfo{
extent_protocol::attr dAttr;
std::string dContent; //Including extent ids inside this dir
};
*/
struct extentInfo{
extent_protocol::attr eAttr;
std::string content; //Including extent ids inside this dir
};
private:
//std::map<extent_protocol::extentid_t, struct fileInfo> files;
//std::map<extent_protocol::extentid_t, struct dirInfo> dirs;
std::map<extent_protocol::extentid_t, struct extentInfo> extents;
public:
extent_server();
int put(extent_protocol::extentid_t id, std::string, int &);
int get(extent_protocol::extentid_t id, std::string &);
int getattr(extent_protocol::extentid_t id, extent_protocol::attr &);
int remove(extent_protocol::extentid_t id, int &);
int setattr(extent_protocol::extentid_t id, extent_protocol::attr, int &);
};
#endif