#pragma once

#ifndef PAGE_REPLACEMENT_HPP
  #define PAGE_REPLACEMENT_HPP

  #include <cstdint>
  #include <vector>

namespace paging {

class replacer {
public:
  explicit replacer(int32_t frame_count) : _frames(frame_count) {}
  virtual ~replacer() = default;

  virtual int32_t run(const std::vector<int32_t> &pages) = 0;

protected:
  int32_t _frames;
};

class optimal_replacer : public replacer {
public:
  using replacer::replacer;
  int32_t run(const std::vector<int32_t> &pages) override;
};

class clock_replacer : public replacer {
public:
  using replacer::replacer;
  int32_t run(const std::vector<int32_t> &pages) override;
};

class lru_replacer : public replacer {
public:
  using replacer::replacer;
  int32_t run(const std::vector<int32_t> &pages) override;
};

} // namespace paging

  #include "../src/paging.cpp"

#endif
