// // tape.hpp // shared_random_generator // // Created by Sam Jaffe on 3/19/23. // Copyright © 2023 Sam Jaffe. All rights reserved. // #pragma once #include #include #include #define DECLARE_TAPE(T) \ T apply(Distribution const & dist) final; \ T apply(Distribution const & dist, T value); namespace engine::random { class Tape : public Device { public: // Allow for the serialization and de-serialization of this Tape using serial_type = std::vector>; private: size_t index_{0}; // transient serial_type entries_; public: Tape() = default; Tape(serial_type serial) : entries_(std::move(serial)) {} explicit operator serial_type() const { return entries_; } IMPLEMENT_DEVICE(DECLARE_TAPE) private: result_type operator()() final { throw; } template T poll(std::string const & dist); template T operator()(Distribution const & dist); }; } #undef DECLARE_TAPE