Download h source code

/*
 * 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