-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrite.h
More file actions
23 lines (20 loc) · 721 Bytes
/
write.h
File metadata and controls
23 lines (20 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef SRC_WRITE_H
#define SRC_WRITE_H
#include <vector>
#include <cstdio>
#include <cassert>
#include <cstdlib>
#include "data.h"
#include <random>
class Writer {
SharedData& data_;
public:
Writer(SharedData& data) : data_(data) {}
void do_object_write(std::vector<int>& object_unit, std::vector<int>& disk_unit, int size, int tag, int object_id);
void write_action();
bool is_disk_space_sufficient(const std::vector<int> &disk_unit, int size);
void do_segregated_fit(std::vector<int> &object_unit, std::vector<int> &disk_unit, int size, int object_id,int lower_bound,int upper_bound, int* current_write_point);
int change_disk=false;
int change_count = 0;
};
#endif //SRC_WRITE_H