Download h source code

 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
/*
 * Copyright 2021 Jeisson Hidalgo-Cespedes - Universidad de Costa Rica
 */

#ifndef SIMULATION_H
#define SIMULATION_H

#include "array.h"

typedef struct {
  size_t thread_count;
  array_t work;
  data_t total_duration;
} simulation_t;

void simulation_init(simulation_t* simulation);
void simulation_destroy(simulation_t* simulation);
int simulation_run(simulation_t* simulation, int argc, char* argv[]);

#endif  // SIMULATION_H

#if 0
#include <vector>

class Simulation {
 private:
  size_t thread_count;
  std::vector<useconds_t> work;

 public:
  Simulation();
  ~Simulation();
  int run(int argc, char* argv[]);

 private:
  analyze_arguments(int argc, char* argv[]);
};
#endif