|
|
@@ -22,19 +22,22 @@ class Tape : public Device {
|
|
|
public:
|
|
|
// Allow for the serialization and de-serialization of this Tape
|
|
|
using serial_type = std::vector<std::pair<std::string, uint64_t>>;
|
|
|
+ friend class Random;
|
|
|
|
|
|
private:
|
|
|
size_t index_{0}; // transient
|
|
|
serial_type entries_;
|
|
|
+ std::shared_ptr<Tape> child_{nullptr};
|
|
|
|
|
|
public:
|
|
|
Tape() = default;
|
|
|
+ Tape(std::shared_ptr<Tape> child) : child_(child) {}
|
|
|
Tape(serial_type serial) : entries_(std::move(serial)) {}
|
|
|
explicit operator serial_type() const { return entries_; }
|
|
|
|
|
|
+private:
|
|
|
IMPLEMENT_DEVICE(DECLARE_TAPE)
|
|
|
|
|
|
-private:
|
|
|
result_type operator()() final { throw; }
|
|
|
template <typename T> T poll(std::string const & dist);
|
|
|
template <typename T> T operator()(Distribution<T> const & dist);
|