-
Notifications
You must be signed in to change notification settings - Fork 56
/
request.h
61 lines (46 loc) · 895 Bytes
/
request.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
#ifndef REQUEST_H
#define REQUEST_H
#include <cstdint>
#include <iostream>
typedef uint64_t IdType;
// Request information
class SimpleRequest
{
private:
IdType _id; // request object id
uint64_t _size; // request size in bytes
public:
SimpleRequest()
{
}
virtual ~SimpleRequest()
{
}
// Create request
SimpleRequest(IdType id, uint64_t size)
: _id(id),
_size(size)
{
}
void reinit(IdType id, uint64_t size)
{
_id = id;
_size = size;
}
// Print request to stdout
void print() const
{
std::cout << "id" << getId() << " size " << getSize() << std::endl;
}
// Get request object id
IdType getId() const
{
return _id;
}
// Get request size in bytes
uint64_t getSize() const
{
return _size;
}
};
#endif /* REQUEST_H */